LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Visual Basic References

Hi all,

I want my program to automatically install all the applicable references and
I found a bit of code that looked like it would work however it didn't it
came up with 'error 1004 Programmatic access to Visual Basic Project is not
trusted'.How can I get arround this, below is my code.

Private Sub Workbook_Open()
'Visual Basic for Applications
ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common
Files\Microsoft Shared\VBA\VBA6\VBE6.DLL")
'Microsoft Excel 11 Object Library
ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Microsoft
Office\OFFICE11\EXCEL.EXE")
'OLE Automation
ThisWorkbook.VBProject.References.AddFromFile
("C:\WINDOWS\system32\STDOLE2.TLB")
'Microsoft Office 11 Object Library
ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common
Files\Microsoft Shared\OFFICE11\MSO.DLL")
'Microsoft Forms 2.0 Object Library
ThisWorkbook.VBProject.References.AddFromFile ("C:\WINDOWS\system32\FM20.DLL")
'Microsoft Office Web Components 11.0
ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common
Files\Microsoft Shared\Web Components\11\OWC11.DLL")
'Microsoft Office Web Components 9.0
ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Microsoft
Office\Office\MSOWC.DLL")
End Sub

Thanks in adavnce

Jason


 
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
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Macro Calling Visual Basic References phauenstein Excel Discussion (Misc queries) 1 August 24th 05 09:28 PM
Changing Formula References in Visual Basic EmmaC. Excel Programming 0 March 1st 04 04:08 PM
Locking Visual Basic Cell References Felicia[_2_] Excel Programming 3 November 5th 03 09:48 PM


All times are GMT +1. The time now is 09:04 AM.

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"