ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running macro with different references (https://www.excelbanter.com/excel-programming/381451-running-macro-different-references.html)

Michelle Hanan

Running macro with different references
 
I wrote a macro on my PC about 4 months ago. Now it is being used by someone
else on a different PC. It still runs just fine for me on my PC, but not on
her PC. I checked her references and am wondering if it would make a
difference that her office, excel and word are 10.0 object libraries and
mine are 11.0? Could this be what's causing it to run weird on her PC?



Michelle Hanan

Running macro with different references
 
I looked for that piece of code and it's not in there. My macro merges data
from the worksheet onto word documents, don't know if this changes anything.
By weird I mean it's printing duplicate documents and printing things that
aren't supposed to print, that sort of thing.
"Jim Thomlinson" wrote in message
...
If you recorded a macro in XL 11 and try to run it on 10 there could be
some
issues with backwards compatibility. Most likely (just a guess here but
something to look for) is that you macro performs a sort at some point. In
XL
11 a new parameter was added to the sort functionallity
"DataOption1:=xlSortNormal". Just remove that piece and the code will
probably run OK on the other system.
--
HTH...

Jim Thomlinson


"Michelle Hanan" wrote:

I wrote a macro on my PC about 4 months ago. Now it is being used by
someone
else on a different PC. It still runs just fine for me on my PC, but not
on
her PC. I checked her references and am wondering if it would make a
difference that her office, excel and word are 10.0 object libraries and
mine are 11.0? Could this be what's causing it to run weird on her PC?






Michelle Hanan

Running macro with different references
 
I do reference to word 11.0. I also use late binding already in my code.
?
"Jim Thomlinson" wrote in message
...
Do you explicitly create a refernce to Word (in the VBE tools -
references
- microsoft Word 11.0) if so then you should remove that reference from
your
spread sheet and change your code to late binding...

Change (early binding)
dim appWord as Word.Application

to (late binding)
dim appWord as object

Set appWord = CreateObject("Word.Application")
--
HTH...

Jim Thomlinson


"Michelle Hanan" wrote:

I looked for that piece of code and it's not in there. My macro merges
data
from the worksheet onto word documents, don't know if this changes
anything.
By weird I mean it's printing duplicate documents and printing things
that
aren't supposed to print, that sort of thing.
"Jim Thomlinson" wrote in
message
...
If you recorded a macro in XL 11 and try to run it on 10 there could be
some
issues with backwards compatibility. Most likely (just a guess here but
something to look for) is that you macro performs a sort at some point.
In
XL
11 a new parameter was added to the sort functionallity
"DataOption1:=xlSortNormal". Just remove that piece and the code will
probably run OK on the other system.
--
HTH...

Jim Thomlinson


"Michelle Hanan" wrote:

I wrote a macro on my PC about 4 months ago. Now it is being used by
someone
else on a different PC. It still runs just fine for me on my PC, but
not
on
her PC. I checked her references and am wondering if it would make a
difference that her office, excel and word are 10.0 object libraries
and
mine are 11.0? Could this be what's causing it to run weird on her PC?










All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com