Using Macros across different office versions

P

PMC1

Hi,

I have an excel speadsheet that conatains a macro which performs some
automation tasks. The Macro was originally written with Office XP on
a
Windows XP System. The idea is something like the following:


1. Original template file opened (Read only) by party X who enters
some info into a form
2. When the command button in Excel is clicked a copy of the workbook
is saved and attached to an email which is sent to Party Y
3. Party Y who is using Office 2003 opens the sheet attached to the
email, makes some further changes to the form, then clicks the button
again. This saves a new copy and attaches the new copy to an email
which is passed back to Party X.


The problem is that the orignal workbook has "References" to various
Microsoft Office 10 Object Libraries (Excel and Outlook). When this
copy is opened using Office 2003 these references are updated to
point
to Microsoft Office 11 Object Libraries and the Macro runs fine but
when this is saved and passed back to Party X as in stage 3 mentioned
above the object Libraries (specifically the Outlook Object
Libraries)
don't revert back to Microsoft Office 10 Libraries as hoped.


So in short how can I get a macro saved in Office 2003 to work in
Office XP?


Any help on this would be appreciated.


Paul
 
N

NickHK

Excel seems to be able to fix its own references along with that to the
Office library:

XL2000:
Create WB with some code.
References seen to XL 9.0
Save & Close

XL2002:
Open above saved WB
References seen to XL 10.0
Save As & Close

XL2000:
Open above saved WB
References seen to XL 9.0

So it would be the other reference(s), Outlook etc, that are not being
"down-dated". As it seems like your code is working and tested, you can drop
the references (and lose the benefit of Intellisense, but that is no longer
a concern) and switch to Late Binding, from your current Early Binding.
Whilst there is a slight performance hit and you cannot use Events with the
late bound objects, this would be the easiest way.
http://peltiertech.com/Excel/EarlyLateBinding.html

NickHK
 
P

PMC1

Excel seems to be able to fix its own references along with that to the
Office library:

XL2000:
Create WB with some code.
References seen to XL 9.0
Save & Close

XL2002:
Open above saved WB
References seen to XL 10.0
Save As & Close

XL2000:
Open above saved WB
References seen to XL 9.0

So it would be the other reference(s), Outlook etc, that are not being
"down-dated". As it seems like your code is working and tested, you can drop
the references (and lose the benefit of Intellisense, but that is no longer
a concern) and switch to Late Binding, from your current Early Binding.
Whilst there is a slight performance hit and you cannot use Events with the
late bound objects, this would be the easiest way.http://peltiertech.com/Excel/EarlyLateBinding.html

NickHK












- Show quoted text -

Thanks Nick. That was very helpful. Problem solved!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top