Hello,
(Using cells.net 7.4.3.1, C# asp.net)
I'm having trouble saving a macro-enabled Excel 2007 file.
The problem is that when I send the file to the client in the Response object, the user gets two 'warnings' in the Excel pop-up dialog One is expected--the "Enable Content?" warning for macros.
But in below that, in the "Links" section, it says that "automatic link updates are disabled, do you want to update these links?" There are no links in this file, nor are any (intentionally) introduced in the code. The link shown in the dialog is the exact same name as the Excel file itself.
For kicks, I click 'enable', and then 'Update Links', and point the "linked" file to itself (in the default IE temp directory), and the "link" dissappears as if everything is ok. Except that when any code runs in this file, it pops up a message saying the file is locked in 'read only' mode by the very user who just opened it--so it's basically locking itself.
The code essentially uses a template xlsm file with some vba code. Below is code to open that template:
WorkbookDesigner wd = new WorkbookDesigner();
LoadOptions ld = new LoadOptions(LoadFormat.Xlsx);//There is NO "Xlsm" option here??
wd.Workbook = new Workbook(FilePath,ld);
//snip, snip, stuff done, .Process, etc.
wd.Workbook.Save(Response, TempFile, ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsm));//Here I have .Xlsm available
I have tried the above using:
new Workbook(FilePath); //(without the LoadOptions overload
And there is no difference.
Thanks for any guidance on this.
--James