Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default File freezing - Trust access to Visual Basic Project setting

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default File freezing - Trust access to Visual Basic Project setting

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

--
Jim
"Cresta" wrote in message
...
| 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
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default File freezing - Trust access to Visual Basic Project setting

Thats what I thought.

That bit of code has worked fine, thankyou.

"Jim Rech" wrote:

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

--
Jim
"Cresta" wrote in message
...
| 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
|



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trust access to visual basic project is grayed out [email protected] Excel Programming 3 September 22nd 06 04:07 PM
Trust Access to Visual Basic Project Farah[_7_] Excel Programming 0 November 7th 05 01:17 PM
Trust access to visual basic project in XP systems kasi Excel Discussion (Misc queries) 5 October 13th 05 01:32 PM
Trust access to visual basic project greyed out Amit Shanker Excel Discussion (Misc queries) 2 March 5th 05 09:41 PM
This option(Trust access to visual basic project ) is not active . hesham Excel Programming 0 October 31st 04 01:29 PM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"