Hello, New to the Board but really need some help.
I work for a large organisation (6000 + PCs). I work on a team where we capture info on a excel spreadhsheet that has embedded macros. These workbooks get sent to different users who add their contribution to the workbook and save the changes to the workbook before returning to me.
The problem is that different users are using differnt versions of MS office, which means that if someone opens the document in office 2003 and saves the changes, the office 2000 reference is replaced by the office 2003 library, so when i get the file back it crashes and i have to change the reference manually.
I flagged this up weeks ago as an issue in the hope that i could amend the excel workbook we send out with something like :- (which would run on workbook open)
Set ref = Application.VBE.ActiveVBProject.References("Outlook")
Application.VBE.ActiveVBProject.References.Remove ref
Application.VBE.ActiveVBProject.References.AddFromFile_ "D:\Applications\Office2000\OFFICE9\msoutl.olb"
Sadly this option was not embraced, more PCs have been upgraded to Office 2003 and this is a time consuming issue
What i want to do is have a 'Master tool' that opens each template and sucks the new data out of them, fixing teh invalid reference as it goes. The reference MUST be fixed becuase i might forward the document onto another user that doesnt have Office 2003, and they will experience the same issue
Can i do something similar to the above code, but not in the active project.
something like :-
Dim wbsource as workbook
set ref = wbsource.application.vbe.activevbproject.references ("Outlook")
Blah blah.
So im affecting the VBE of the damaged excel workbook rather than the active project?
I tried it but get an error saying it conflicts with an existing library
Am i on the right lines?
The Master tool will user Microsfot Outlook object library 9.0 and so will the excel workbooks i send out. But when i receive the excel workbook back it will contain "Microsfot Outlook object library 10.0" which wont be on my PC, hence i want the code to automaticall open, replace the invalid reference with a valid one and close it down again.
Hope ive not over empasised. Any thoughts greatfully received
I work for a large organisation (6000 + PCs). I work on a team where we capture info on a excel spreadhsheet that has embedded macros. These workbooks get sent to different users who add their contribution to the workbook and save the changes to the workbook before returning to me.
The problem is that different users are using differnt versions of MS office, which means that if someone opens the document in office 2003 and saves the changes, the office 2000 reference is replaced by the office 2003 library, so when i get the file back it crashes and i have to change the reference manually.
I flagged this up weeks ago as an issue in the hope that i could amend the excel workbook we send out with something like :- (which would run on workbook open)
Set ref = Application.VBE.ActiveVBProject.References("Outlook")
Application.VBE.ActiveVBProject.References.Remove ref
Application.VBE.ActiveVBProject.References.AddFromFile_ "D:\Applications\Office2000\OFFICE9\msoutl.olb"
Sadly this option was not embraced, more PCs have been upgraded to Office 2003 and this is a time consuming issue
What i want to do is have a 'Master tool' that opens each template and sucks the new data out of them, fixing teh invalid reference as it goes. The reference MUST be fixed becuase i might forward the document onto another user that doesnt have Office 2003, and they will experience the same issue
Can i do something similar to the above code, but not in the active project.
something like :-
Dim wbsource as workbook
set ref = wbsource.application.vbe.activevbproject.references ("Outlook")
Blah blah.
So im affecting the VBE of the damaged excel workbook rather than the active project?
I tried it but get an error saying it conflicts with an existing library
Am i on the right lines?
The Master tool will user Microsfot Outlook object library 9.0 and so will the excel workbooks i send out. But when i receive the excel workbook back it will contain "Microsfot Outlook object library 10.0" which wont be on my PC, hence i want the code to automaticall open, replace the invalid reference with a valid one and close it down again.
Hope ive not over empasised. Any thoughts greatfully received