Currently, we have a report which runs
- User triggers the report
- report is processed and saved in xml format
- When the report is finished, user get the option to download the report
- When user clicks on download, a web service is called.
- this web service opens blank excel book
- copies macro from a separate xml module (which resides in the server)
- Macro processes finished xml report and show it in the sheets
This all works perfectly fine when using Excel 2002 (SP 3).
Our workstations are planned for upgrade from XP to Windows 7. With Windows 7, comes Excel 2010. I tried the whole step in the testing machine provided by infra team.
When testing, we found that macro from xml module was not getting copied in excel 2010. No errors and no warnings.
I did a bit of searching and found that "Trust access to the VBA project object model" needs to be ticked. Tried doing it but to no avail.
Let me know if anything is not clear or need more information.
Edit 1 This is how JS is opening the excel + adding workbook + adding module:
xlApp = new ActiveXObject("Excel.Application");
//Add a workbook
xlBook = xlApp.Workbooks.Add;
// This loads the modules into XL from the reporter_modules
var xlMod;
xlMod = xlBook.VBProject.VBComponents.Add(1);
xlMod.CodeModule.AddFromString(xmlModule.childNodes(i).text);
Since there is just .xls in Excel 2002, code does not mention the extension while opening excel anywhere. Do you know how can this be achieved?
Thanks, Meet