On Windows 2003, I wrote a web application using C# in dot net. User can trigger the server to dynamically create an Excel file and save it to disk for download.
So far so good. But when I want to also save VB script into the Excel, I get "[login to view URL] (0x800A03EC): Programmatic access to Visual Basic Project is not trusted", unless I keep the identify that the website is running under logged in.
To repeat: If I have my webside running under WEBUSER, then if I login to the server as WEBUSER and leave that process open, I can go to any computer and visit the site and see the feature work fine. If I do not have this user logged in on the server, then creating simple excel file with tables work. But if I create the excel with macro, I get the above error.
? ? ? ? ? ? ? ? ? ? ? sVBACode =
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Public Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) \r\n" +
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "? ? Cancel = NOT DoValidation() \r\n" +
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "End Sub";
? ? ? ? ? ? ? ? ? ? ? for (int i=0; i<[login to view URL]; i++){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if ("ThisWorkbook".Equals([login to view URL](i + 1).Name)){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [login to view URL](i + 1).[login to view URL](sVBACode);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? }
I'd like you to help me solve this.? I can give additional info upon request. I can also give you remote control to my Computer if needed.