|
-
Jan 12th, 2006, 08:59 AM
#1
Thread Starter
New Member
Programmatic access to Visual Basic is not trusted
I want to export some data from my application to an excel sheet, in the export, I also want to create a macro command and add a checkbox associated to that macro, but I got an error because of the :
Programmatic access to Visual Basic is not trusted
I can resolve the problem by checking the option directly in Excel, but it is not a good way to resolve a problem since, I wont be the one using the app...
Is there a way to programmaticly check the option in my VB code?
-
Jan 12th, 2006, 11:06 AM
#2
Re: Programmatic access to Visual Basic is not trusted
Sounds like you code is accessing the VBA IDE code? There is not way to "programmatically" check the "Trust" option.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 12th, 2006, 02:36 PM
#3
Thread Starter
New Member
Re: Programmatic access to Visual Basic is not trusted
Tx, that is what I was afraid of.
I thought there might have been a way by changing setting in the registry directly.
-
Jan 12th, 2006, 02:38 PM
#4
Re: Programmatic access to Visual Basic is not trusted
If there was a way, it would defeat the purpose of security for macros as code could run regardless of the users security settings, etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 6th, 2009, 11:26 AM
#5
New Member
Re: Programmatic access to Visual Basic is not trusted
Well, if by "check" you mean "click the checkbox", then yeah, I can see why that would be a security hole and hence it makes sense that it's not allowed. However, I found this thread because I was looking for a way to programmatically confirm the current setting (another definition of "check"... as in, to "check up on something"), and I get the impression that's not possible either. I'm trying to write a script that would create Macros if the user's security settings allowed, but if they didn't, it would quietly just not bother making any Macros rather than bombing out. Is there some way to peek in at the current setting programmatically?
-
Jun 6th, 2009, 11:10 PM
#6
Re: Programmatic access to Visual Basic is not trusted
rightly or wrongly you can change the security setting by editing the registry key, but not while excel is open
you can read the key to determine the security level while excel is open
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|