Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA references not sticking

Status
Not open for further replies.

DBAchick

Programmer
Apr 27, 2000
61
I created an excel spreadsheet that performs some email tasks using vba for applications. I set the references in the VB editor, but when I send the spreadsheet to someone else, they receive errors until we set the references on THEIR machine as well.

Is there a way to 'complile' the spreadsheet so the references stay with it?

Any help is appreciated!

 
Hi, DBAchick!

Can you elaborate a little more. Where do the references point to? What are these refs? etc.

Thanks.

Indu
 
The references that are set in my Excel spreadsheet are:

Visual Basic For Applications
(C:\Program Files\Common Files\MicrosoftShared\...)
Microsoft Excel 9.0 Object Library
(C:\Program Files\Microsoft Office\...)
OLE Automation
(C:\Windows\System32...)
Microsoft Office 9.0 Object Library
(C:\Program Files\MSProject...)
Microsoft Forms 2.0 Object Library
(C:\Windows\System32..._
Microsoft Outlook 10.0 Object Library
(C:\Program Files\Microsoft Office\...)

I am running Office 2000 and so are the individuals who are opening the file. The reference that really seems to cause the problems is the Microsoft Outlook 10.0 object library. I have checked the target machines and the reference file exists, it is just no longer checked in the spreadsheet when the target system opens the file.

I hope this is enough additional information for you to help me out.

Thanks so much!
 
I have had similar problems with this in Access(in my case caused by one of the users using a more modern version of Access). How I got round it was to copy the relevant files to a shared network drive (if that is possible in your situation) and pointed the references to those files.

Not ideal I know but it worked for me, I'm sure there is a more elegant solution

Andy
 
I take it that using

Application.VBE.ActiveVBProject.References.AddFromFile "C:\program files\microsoft office\office\msoutl8.olb"

doen't work as it should.

I found a posting by Dick Kusleika for late binding:

Dim ol as Object
Dim ns as Object
Dim olmail as Object

Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNameSpace("MAPI")


Hope that helps.

Indu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top