Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

File freezing - Trust access to Visual Basic Project setting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cresta - 19 Sep 2007 10:50 GMT
Hello and help.
I am getting frequent service desk calls regarding a heavily macro'd Excel
file freezing when it is being opened, and its all because the "Trust access
to Visual Basic Project" setting is not ticked.
I know the setting cannot be changed by code, for obvious security reasons,
so I am trying to get the file to check this setting at startup, give the
user a message to make the relevant setting changes, and to stop the file
from freezing.  
Is there any simple code to check this setting and return a value to trigger
the above steps if required.
Thanks
Jim Rech - 19 Sep 2007 12:24 GMT
I don't understand the freezing part because code will usually run or
generate an error.  It doesn't just stop.  But anyway this seems to return
whether VBE access is trusted.

Sub TestVBE_Trusted()
   If VBE_Trusted Then
       MsgBox "VBE Trusted"
   Else
       MsgBox "VBE NOT Trusted"
   End If
End Sub

Function VBE_Trusted() As Boolean
   Dim X As Variant
   On Error Resume Next
   Err.Clear
   X = Application.VBE.Version
   VBE_Trusted = (Err.Number = 0)
End Function

Signature

Jim

| Hello and help.
| I am getting frequent service desk calls regarding a heavily macro'd Excel
[quoted text clipped - 7 lines]
| the above steps if required.
| Thanks
Cresta - 19 Sep 2007 13:30 GMT
Thats what I thought.

That bit of code has worked fine, thankyou.

> I don't understand the freezing part because code will usually run or
> generate an error.  It doesn't just stop.  But anyway this seems to return
[quoted text clipped - 30 lines]
> | the above steps if required.
> | Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.