I want to use the
Excel's Workbook Method SaveAs because I want to change the
Save as Type and save my workbook in
Formatted Text (Space delimited) (*.prn).
But this method has many parameters of type System.Object and I can't find this assembly and I am using NAV variables instead. Text, boollean,integer but it doesn't work and in return I get this error message:
A dotnet variable has not been instantiated. Attempting to call Microsoft.Office.Interop.Excel.Workbook.SaveAs in Table Excel Buffer: SaveAs
Does this means that the method is not initiated properly with the correct variables? But how can I declare a System.Object variable in NAV?
This is the code I am using:
XlWrkBk.SaveAs(
FileName,FileFormat,Password,WriteResPassword,ReadOnlyRecommended,CreateBackup,
XLSAVEASACCESSMODE,ConflictResolution,AddToMru,TextCodepage,TextVisualLayout,Local);
Comments
Below two link will be help to you.
_Workbook.SaveAs Method : http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._workbook.saveas%28v=office.14%29.aspx
Problem with Workbook.SaveAs :
http://social.msdn.microsoft.com/Forums ... m=exceldev
I copied the sample code from Workbook.Saveas topic
Best Regards,
Yukon
Do you use this code in Nav or its just an example of how it will looks like in C#?
I tried to use the following variables but no luck!
Did you find a solution to your problem? I have a similar problem. I need to call a DotNet Method but I need to pass some System.Object parameters. These are optional parameters, but I guess optional parameters are not supported in NAV. Therefore I have to explicitly pass these "empty" parameters anyhow.
Much appreciated...