Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default VBA reference error

I have an application which works fine in my home environment. When I
run it at work though I get the following error message;

Run-time error '1004':

'Programmatic access to Visual Basic Project not trusted'

after the follwing routine;

With Application.VBE.ActiveVBProject.References
On Error Resume Next
.AddFromFile Filename:="msoutl9.olb"
If Err Then .AddFromFile Filename:="msoutl.olb"
On Error GoTo 0
End With

It stops on the first row.

Protection of the project is not activated (password written but not in
'use'. When I remove the password the error message changes to the
following;

'<Method 'VBE' of object '_application' failed'

Again it stops on the first row.

At home I use Excel 2000 9.0 in a W2000-environment and at work Excel
10.0.

What I want to handle is to open the reference in Excel to Outlook in
case it is not already open.

Another 'error' I encounter at work is that when I open the file I get
the following message;

'Excel encountered an error and had to remove some formatting to avoid
corrupting the workbook. Please re-check your formatting carefully.'

Is there any way to find out where to find the incorrect formatting? Is
there perhaps a connection between the two errors above and formatting
error?

If necessary I can forward the entire file. I might need to 'clean it
up' a litle since it is partly in Swedish. Any help is much appreciated.

Best regards,

Thor



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VBA reference error

Hi Thor

See this information from John Walkenbach
http://www.j-walk.com/ss/excel/tips/tip96.htm

About the Outlook reference:
You can use Binding for that
http://www.dicks-clicks.com/excel/olBinding.htm


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Thor" wrote in message ...
I have an application which works fine in my home environment. When I
run it at work though I get the following error message;

Run-time error '1004':

'Programmatic access to Visual Basic Project not trusted'

after the follwing routine;

With Application.VBE.ActiveVBProject.References
On Error Resume Next
.AddFromFile Filename:="msoutl9.olb"
If Err Then .AddFromFile Filename:="msoutl.olb"
On Error GoTo 0
End With

It stops on the first row.

Protection of the project is not activated (password written but not in
'use'. When I remove the password the error message changes to the
following;

'<Method 'VBE' of object '_application' failed'

Again it stops on the first row.

At home I use Excel 2000 9.0 in a W2000-environment and at work Excel
10.0.

What I want to handle is to open the reference in Excel to Outlook in
case it is not already open.

Another 'error' I encounter at work is that when I open the file I get
the following message;

'Excel encountered an error and had to remove some formatting to avoid
corrupting the workbook. Please re-check your formatting carefully.'

Is there any way to find out where to find the incorrect formatting? Is
there perhaps a connection between the two errors above and formatting
error?

If necessary I can forward the entire file. I might need to 'clean it
up' a litle since it is partly in Swedish. Any help is much appreciated.

Best regards,

Thor



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
#N/A Error Reference Sergio Excel Worksheet Functions 2 November 2nd 09 06:09 PM
External xls reference error Fluke[_2_] Excel Worksheet Functions 1 May 22nd 09 10:14 AM
Circular Reference Error The Narcissist Excel Worksheet Functions 1 September 13th 08 03:14 AM
reference #value error DrXerox Excel Worksheet Functions 0 July 22nd 05 03:56 AM
Maddening reference error Wowbagger New Users to Excel 2 May 23rd 05 02:48 PM


All times are GMT +1. The time now is 03:19 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"