Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Error querying for open VBprojects in XP?

An add-in of mine checks to see whether an add-in is
installed OR loaded, since it will work in both cases. To
see whether the add-in is loaded, I use

Dim AddInLoaded As Boolean
Dim p As Object
AddInLoaded = False
For Each p In Application.VBE.VBProjects
AddInLoaded = AddInLoaded Or (p.Name = "MyAddInName")
Next p

This worked fine with Excel97 and Excel2000, but I get a
run-time error 1004 in the latest Excel versions:
something to do with accessing projects from within a
project. Is there a way to get around this that will work
with the older XL-versions as well?

TIA, Arne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Error querying for open VBprojects in XP?

Does that 1004 say:
"Programmatic access to Visual Basic Project is not trusted"?

If yes, then you're getting stopped by a user setting. You can change yours by:

Tools|macros|security|Trusted sources tab

check "Trust access to Visual Basic Project"

This is a user by user change--not something you can change in your code.

Arne wrote:

An add-in of mine checks to see whether an add-in is
installed OR loaded, since it will work in both cases. To
see whether the add-in is loaded, I use

Dim AddInLoaded As Boolean
Dim p As Object
AddInLoaded = False
For Each p In Application.VBE.VBProjects
AddInLoaded = AddInLoaded Or (p.Name = "MyAddInName")
Next p

This worked fine with Excel97 and Excel2000, but I get a
run-time error 1004 in the latest Excel versions:
something to do with accessing projects from within a
project. Is there a way to get around this that will work
with the older XL-versions as well?

TIA, Arne


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Error querying for open VBprojects in XP?

-----Original Message-----
Does that 1004 say:
"Programmatic access to Visual Basic Project is not

trusted"?

Indeed it did say that, beit in another language :-)


If yes, then you're getting stopped by a user setting.

You can change yours by:

Tools|macros|security|Trusted sources tab

check "Trust access to Visual Basic Project"

This is a user by user change--not something you can

change in your code.


Thanks for the help.

Arne

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
Querying Worksheets thefonz37 Excel Worksheet Functions 5 March 25th 08 04:55 AM
EXCEL:Can't open any file without error saying it's ALREADY open??? Crackles McFarly Excel Worksheet Functions 1 November 1st 07 02:22 AM
Error in querying data from MS Access aemAndy Excel Discussion (Misc queries) 1 April 16th 07 06:54 PM
Querying data [email protected] Excel Discussion (Misc queries) 1 February 23rd 07 01:43 PM
Web Querying from excel. [email protected] Excel Programming 3 December 7th 03 02:01 PM


All times are GMT +1. The time now is 12:28 PM.

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"