_Hello,
I am trying to use the dlls so I can take advantage of the export and import functionality. I built a console app. The solutions has referenced all the dll's that I assume would be needed.
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using tomenglertde.ResXManager.Model;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using tomenglertde.ResXManager.View;
using DocumentFormat.OpenXml.ExtendedProperties;
using Microsoft.Win32;
using EnvDTE;
using tomenglertde.ResXManager.VSIX;
using tomenglertde.ResXManager;
using System.Windows;
Export works fine:_
//Code below creates an excel in the same format as the tool itself
string solutionFolder = @"C:\project-test\ConsoleApplicationUploadtest";
ResourceManager x = new ResourceManager();
x.Load(solutionFolder);
ExcelExtensions.ExportExcel(x, @"C:\Users\sfarahba\Desktop\test\test0527(2).xlsx", null);
Import runs fine but does not actualy change any of the values that were edited in the excel document:
//the following code imports an excel ainto the resouce
string solutionFolder = @"C:\project-test\ConsoleApplicationUploadtest";
ResourceManager x = new ResourceManager();
x.Load(solutionFolder);
ExcelExtensions.ImportExcel(x, @"C:\Users\sfarahba\Desktop\test\test0527(2).xlsx");
</br></br>
What is wrong with my Import? Am I declaring and loading the resource manager object properly?
I have tried everything but importing does not work this way. I get no errors but any of the values that I change in the excel does not actually update the resx when I perform import?
Comments: ** Comment from web user: hessamf2000 **
Now I am using your solution.
I am able to export;
Import works, but doesn't actually change the values in the resource. Maybe as you mentioned I am not saving the resource? How do I do that?
Here is what I have(also attached a zip of my console app):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ResourceManager;
using ResourceManager.Client;
using ResourceManager.Converter;
using ResourceManager.Core;
using ResourceManager.Storage;
using ClosedXML.Excel;
using ResourceManager.Converter.Exceptions;
namespace ConsoleApplicationRexMnag2XXXXdlls
{
class Program
{
static void Main(string[] args)
{
//my solution that contains the resource
VSSolution solution = new VSSolution("C:\\projects\\NRCANNETMVCWet\\trunk\\src\\NRCan.Web.Solution\\slnNRCan.sln");
//Export
XlsxConverter x = new XlsxConverter(solution);
x.Export("C:\\Users\\sfarahba\\Desktop\\DemoApp-fr(test1).xlsx");
//Import
//this does not work
x.Import("C:\\Users\\sfarahba\\Desktop\\DemoApp-fr(test1).xlsx");
//for import I also tried this
//ExcelConverter x = new ExcelConverter(solution);
//x.Import("C:\\Users\\sfarahba\\Desktop\\DemoApp-fr(test1),.xlsx");
}
}
}