Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Programmactic access to Visual Basic Project is not trusted

Hello everyone,

Because of this piece fo code:
...
Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)

I get this error message:
"Programmactic access to Visual Basic Project is not trusted"

(What good is it then?)

Does anyone know how to circumvent this?


TIA

Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Programmactic access to Visual Basic Project is not trusted

Hi
goto 'Tools - Macros - Security' and on the second tab of this dialog
allow access to the VBA project

--
Regards
Frank Kabel
Frankfurt, Germany

"Peter" schrieb im Newsbeitrag
...
Hello everyone,

Because of this piece fo code:
...
Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)

I get this error message:
"Programmactic access to Visual Basic Project is not trusted"

(What good is it

then?)

Does anyone know how to circumvent this?


TIA

Peter



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Programmactic access to Visual Basic Project is not trusted

NOTE:

if you are using Excel 2003 the box in
macro security options is greyed out.

the registry setting was moved from user to machine
and you can no longer change it from the UI.

Run the program regedit.exe
goto:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\ Excel\Security
Add or Change a DWORD named AccessVBOM to Value 1




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Frank Kabel wrote in message
:

Hi
goto 'Tools - Macros - Security' and on the second tab of this dialog
allow access to the VBA project

--
Regards
Frank Kabel
Frankfurt, Germany

"Peter" schrieb im Newsbeitrag
...
Hello everyone,

Because of this piece fo code: ...
Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)

I get this error message:
"Programmactic access to Visual Basic Project is not trusted"

(What good is it
then?)

Does anyone know how to circumvent this?


TIA

Peter




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Programmactic access to Visual Basic Project is not trusted

Hi Jurgen
for me (using Excel 2003 / German) no problem to change this setting in
the UI directly. But I'm logged in as admin. So could be the reason for
this

--
Regards
Frank Kabel
Frankfurt, Germany

"keepITcool" schrieb im Newsbeitrag
...
NOTE:

if you are using Excel 2003 the box in
macro security options is greyed out.

the registry setting was moved from user to machine
and you can no longer change it from the UI.

Run the program regedit.exe
goto:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\ Excel\Security
Add or Change a DWORD named AccessVBOM to Value 1




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Frank Kabel wrote in message
:

Hi
goto 'Tools - Macros - Security' and on the second tab of this

dialog
allow access to the VBA project

--
Regards
Frank Kabel
Frankfurt, Germany

"Peter" schrieb im Newsbeitrag
...
Hello everyone,

Because of this piece fo code: ...
Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)

I get this error message:
"Programmactic access to Visual Basic Project is not trusted"

(What good is it
then?)

Does anyone know how to circumvent this?


TIA

Peter





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Programmactic access to Visual Basic Project is not trusted

Hi Peter

John have a example on his site to avoid the error
http://www.j-walk.com/ss/excel/tips/tip96.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Peter" wrote in message ...
Hello everyone,

Because of this piece fo code:
...
Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)

I get this error message:
"Programmactic access to Visual Basic Project is not trusted"

(What good is it then?)

Does anyone know how to circumvent this?


TIA

Peter






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Programmactic access to Visual Basic Project is not trusted

Hi Peter,

Dim ModuleCount as Long (?)

ModuleCount = ThisWorkbook.VBProject.VBComponents.Count
Sheets.Add After:=Sheets(ModuleCount)


All the replies so far have explained how to turn it back on, but why
are you using it anyway? If you want to add a sheet at the end, use:

ActiveWorkbook.Sheets.Add After:=ActiveWorkbook.Sheets.Count

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


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 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
Programmatic Access to Visual Basic Project is not Trusted Anson[_2_] Excel Programming 2 July 20th 04 02:12 PM
'Programmatic access to Visual Basic project is not trusted.' message Joe Excel Programming 1 February 13th 04 03:19 PM
Allow access to visual basic project netzig Excel Programming 2 February 4th 04 06:06 PM


All times are GMT +1. The time now is 09:47 PM.

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

About Us

"It's about Microsoft Excel"