Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > .NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-30-2009, 03:21 PM
jojo1974 jojo1974 is offline
Registered User
 
Join Date: Oct 2009
Posts: 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")
If I turn off the code then it will load the spreadsheet without the module but the module is the critical part of the spreadsheet.

Does anyone have any ideas?

Regards

Jo
Reply With Quote
  #2  
Old 11-02-2009, 08:54 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
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
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 11:40 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.