Open Excel File Error using SmartObjects - Services - Tester

  • 18 November 2015
  • 0 replies
  • 3 views

Badge +1

I created a custom DLL that opens an excel file, executes a Smartobject, populates information into Excel file ans saves the Excel with another name.

 

Using a console application in Visual Studio, I´m able to create all the process without issues, but after create the SmartObject for this DLL I receive an error that indicates that cannot find the Excel file. It´s odd to only happens with SmartObjects Tester.

 

i´m using this call to open Excel file:

----------------------------------------------------------------------------------------

var xla = new Excel.Application();
if (xla == null)
{
     Console.WriteLine("EXCEL could not be started. Check that your office installation and project references are correct.");
     //return new[] { "0", "0", "0" };
}
xla.Visible = false;
Excel._Workbook wb = xla.Workbooks.Open(@"\" + HostServer + "D$COTExcelTemplate_Upload.xls");
Excel._Worksheet ws = (Excel.Worksheet)xla.Worksheets.get_Item(2);

 

----------------------------------------------------------------------------------------

The variable HostServed is well mapped.

When I type in my computer the address that I receive from SmartObject tester Error, I am able to access the file.

I gave permissions to everyone access to this file with permissions to read/write.

 

Does anyone had this problem before?


0 replies

Be the first to reply!

Reply