Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default programmatic access to visual basic project is not trusted

Hi

I've got some VB code that uses OLE automation to do some stuff in Excel.
I've started getting the error "programmatic access to visual basic project
is not trusted" but I DO have the setting "Trust Access to Visual Basic
Project" enabled.

Interesting points to note:

1. This code has been working (certainly it was last week)

2. If I run my routine from inside Excel then its OK

3. Because of some other problems (A Microsoft security update breaking
something) I had to go back to a restore point. When I then went to
Microsoft update (to prevent the same download happening again) I got 148Mb
of stuff which included lots of Office 2003 "fixes". Is it possible that
they broke something else?

Any ideas?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default programmatic access to visual basic project is not trusted

Oh buggrit buggrit buggrit. Found it.

I instantiate Excel using

Set oExcel = CreateObject("Excel.application")

So that I don't have to worry about the version of the target machines. For
some reason this is instantiating Excel 2002 which DIDN'T have "Trust
Access to Visual Basic Project" enabled.

Now, since I have 2003 installed, how come OLE is running 2002?

Rob

"Rob Kings" wrote in message
...
Hi

I've got some VB code that uses OLE automation to do some stuff in Excel.
I've started getting the error "programmatic access to visual basic
project is not trusted" but I DO have the setting "Trust Access to Visual
Basic Project" enabled.

Interesting points to note:

1. This code has been working (certainly it was last week)

2. If I run my routine from inside Excel then its OK

3. Because of some other problems (A Microsoft security update breaking
something) I had to go back to a restore point. When I then went to
Microsoft update (to prevent the same download happening again) I got
148Mb of stuff which included lots of Office 2003 "fixes". Is it possible
that they broke something else?

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default programmatic access to visual basic project is not trusted

I don't know.

And I don't know if this will work, but it'll give you something to do until
someone smart comes along.

If you have multiple versions of excel on the same pc (I don't), then the
version that should be used when you double click on a .xls file (in windows
explorer) should be the last one installed (or the last one registered).

So I'd try this:
close all running instances of excel
windows start button|Run
c:\path\to\excel2003.exe /unregserver
followed by
c:\path\to\excel2003.exe /regserver

If it works, post back and the smart person coming along later won't waste
his/her time.

If it doesn't work, post back and maybe that smart person will help.



Rob Kings wrote:

Oh buggrit buggrit buggrit. Found it.

I instantiate Excel using

Set oExcel = CreateObject("Excel.application")

So that I don't have to worry about the version of the target machines. For
some reason this is instantiating Excel 2002 which DIDN'T have "Trust
Access to Visual Basic Project" enabled.

Now, since I have 2003 installed, how come OLE is running 2002?

Rob

"Rob Kings" wrote in message
...
Hi

I've got some VB code that uses OLE automation to do some stuff in Excel.
I've started getting the error "programmatic access to visual basic
project is not trusted" but I DO have the setting "Trust Access to Visual
Basic Project" enabled.

Interesting points to note:

1. This code has been working (certainly it was last week)

2. If I run my routine from inside Excel then its OK

3. Because of some other problems (A Microsoft security update breaking
something) I had to go back to a restore point. When I then went to
Microsoft update (to prevent the same download happening again) I got
148Mb of stuff which included lots of Office 2003 "fixes". Is it possible
that they broke something else?

Any ideas?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default programmatic access to visual basic project is not trusted

Dave

Many thanks for that. What I didn't realise until later last night (before I
read your post) was that the version you get when you double-click an XLS
was also 2002. (I tend to switch between double-clicking the files and using
the Quick-Launch toolbar to explicitly launch 2003) I suppose it says a lot
about either me, or just how inconsequential the differences are between
2002 and 2003, that I couldn't spot them !

I'd also looked in the registry at
HKEY_CLASSES_ROOT\Excel.Application\CurVer which is set to
Excel.Application.10 on my machine. I tried setting this to
Excel.Application.11 but it didn't make any difference (so I set it back to
10)

Anyhow, what I did was slightly different to what you wrote.

1. I did an /unregserver on the 2002 version

2. I then tried double-clicking a file and still got 2002

3. I did a /regserver on the 2003 version. This gave me a progress-bar
something like "Please wait whilst Windows checks Office 2003" or something.

After that SUCCESS. Both double-clicking, and OLE bring up 2003

Many many thanks

Rob
"Dave Peterson" wrote in message
...
I don't know.

And I don't know if this will work, but it'll give you something to do
until
someone smart comes along.

If you have multiple versions of excel on the same pc (I don't), then the
version that should be used when you double click on a .xls file (in
windows
explorer) should be the last one installed (or the last one registered).

So I'd try this:
close all running instances of excel
windows start button|Run
c:\path\to\excel2003.exe /unregserver
followed by
c:\path\to\excel2003.exe /regserver

If it works, post back and the smart person coming along later won't waste
his/her time.

If it doesn't work, post back and maybe that smart person will help.



Rob Kings wrote:

Oh buggrit buggrit buggrit. Found it.

I instantiate Excel using

Set oExcel = CreateObject("Excel.application")

So that I don't have to worry about the version of the target machines.
For
some reason this is instantiating Excel 2002 which DIDN'T have "Trust
Access to Visual Basic Project" enabled.

Now, since I have 2003 installed, how come OLE is running 2002?

Rob

"Rob Kings" wrote in message
...
Hi

I've got some VB code that uses OLE automation to do some stuff in
Excel.
I've started getting the error "programmatic access to visual basic
project is not trusted" but I DO have the setting "Trust Access to
Visual
Basic Project" enabled.

Interesting points to note:

1. This code has been working (certainly it was last week)

2. If I run my routine from inside Excel then its OK

3. Because of some other problems (A Microsoft security update breaking
something) I had to go back to a restore point. When I then went to
Microsoft update (to prevent the same download happening again) I got
148Mb of stuff which included lots of Office 2003 "fixes". Is it
possible
that they broke something else?

Any ideas?


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default programmatic access to visual basic project is not trusted

Glad you got it working.

Rob Kings wrote:

Dave

Many thanks for that. What I didn't realise until later last night (before I
read your post) was that the version you get when you double-click an XLS
was also 2002. (I tend to switch between double-clicking the files and using
the Quick-Launch toolbar to explicitly launch 2003) I suppose it says a lot
about either me, or just how inconsequential the differences are between
2002 and 2003, that I couldn't spot them !

I'd also looked in the registry at
HKEY_CLASSES_ROOT\Excel.Application\CurVer which is set to
Excel.Application.10 on my machine. I tried setting this to
Excel.Application.11 but it didn't make any difference (so I set it back to
10)

Anyhow, what I did was slightly different to what you wrote.

1. I did an /unregserver on the 2002 version

2. I then tried double-clicking a file and still got 2002

3. I did a /regserver on the 2003 version. This gave me a progress-bar
something like "Please wait whilst Windows checks Office 2003" or something.

After that SUCCESS. Both double-clicking, and OLE bring up 2003

Many many thanks

Rob
"Dave Peterson" wrote in message
...
I don't know.

And I don't know if this will work, but it'll give you something to do
until
someone smart comes along.

If you have multiple versions of excel on the same pc (I don't), then the
version that should be used when you double click on a .xls file (in
windows
explorer) should be the last one installed (or the last one registered).

So I'd try this:
close all running instances of excel
windows start button|Run
c:\path\to\excel2003.exe /unregserver
followed by
c:\path\to\excel2003.exe /regserver

If it works, post back and the smart person coming along later won't waste
his/her time.

If it doesn't work, post back and maybe that smart person will help.



Rob Kings wrote:

Oh buggrit buggrit buggrit. Found it.

I instantiate Excel using

Set oExcel = CreateObject("Excel.application")

So that I don't have to worry about the version of the target machines.
For
some reason this is instantiating Excel 2002 which DIDN'T have "Trust
Access to Visual Basic Project" enabled.

Now, since I have 2003 installed, how come OLE is running 2002?

Rob

"Rob Kings" wrote in message
...
Hi

I've got some VB code that uses OLE automation to do some stuff in
Excel.
I've started getting the error "programmatic access to visual basic
project is not trusted" but I DO have the setting "Trust Access to
Visual
Basic Project" enabled.

Interesting points to note:

1. This code has been working (certainly it was last week)

2. If I run my routine from inside Excel then its OK

3. Because of some other problems (A Microsoft security update breaking
something) I had to go back to a restore point. When I then went to
Microsoft update (to prevent the same download happening again) I got
148Mb of stuff which included lots of Office 2003 "fixes". Is it
possible
that they broke something else?

Any ideas?


--

Dave Peterson


--

Dave Peterson


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 Farah[_7_] Excel Programming 0 November 7th 05 01:17 PM
Programmactic access to Visual Basic Project is not trusted Peter[_21_] Excel Programming 5 November 16th 04 09:14 AM
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 06:17 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"