|
#1
|
|||
|
|||
|
VB Net 2003 Excel Module problems
Hi, I am hoping someone can help with a problem I am having
I am using ASP (VB).Net 2003 on Windows Server 2003 and I am trying to create a web application which dynamically creates an excel spreadsheet which has a module included. When I run this on the local host it works fine but once I load it onto the server I get the following error message HRESULT = 0x800A17B4 "Programmatic Access to Visual Basic Project is not trusted I am using the following VB.Net code Code:
Dim xlmodule As Object 'VBComponent
xlmodule = xlbook.VBProject.VBComponents.Import(PathToImport & "Module1.bas")
Does anyone have any ideas? Regards Jo |
|
#2
|
||||
|
||||
|
This is a Macro Security setting (macro virus protection) and you cannot change it programmatically.
If this is a Server-Side action, then the Server this is running on can have this setting changed manually via Alt|Tools|Options... then the 'Security' Tab, then the <Macro Security> button, then the 'Trusted Publishers' Tab. At the bottom of that Tab you will see a checkbox named 'Trust access to Visual Basic Project'. You must make sure that checkbox is checked. However, if this is a routine that is to run on the client side, it won't run unless this "Trust access to Visual Basic Project" is also turned on manually. This may require your clients having to lower their macro protection. Asking them to do that is not very nice and most probably won't. Hopefully, however, this routine is Server-Side which would mean it is within your control. You might want to have a read of some of the caveats discussed here: Server-Side Automation of Office
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Executing Excel macros from VB .exe | oamram | VB Classic | 3 | 06-09-2008 04:51 AM |
| define excel table in vb 2005 using oledb excel file | lew26 | Database | 8 | 01-23-2006 04:27 PM |
| Re: Move from VB 6 to VB.Net in 5 easy steps | Jon Ogden | .NET | 84 | 01-29-2001 02:12 PM |