Mac/Windows macro compatibility and recording

T

tfoulsh

Hi,
1.
I have some fairly detailed (and not very well written, my VBA bein
well....basic to say the least) macros from Excel 2004 on XP. The
don't work on my office mac. At all. What stuff might I need t
change.

2.
I thought I might just write them again. I would normally record bit
and pieces especially when unsure of code. I can't get lots of thing
to record (the macro is blank or only shows the last operation). I
particular opening and saving files which is one thing I obviously hav
to change in my old macros.

Any hints?

Thanks in advance for any and all replies.

To
 
B

Bob Greenblatt

Hi,
1.
I have some fairly detailed (and not very well written, my VBA being
well....basic to say the least) macros from Excel 2004 on XP. They
don't work on my office mac. At all. What stuff might I need to
change.

2.
I thought I might just write them again. I would normally record bits
and pieces especially when unsure of code. I can't get lots of things
to record (the macro is blank or only shows the last operation). In
particular opening and saving files which is one thing I obviously have
to change in my old macros.

Any hints?

Thanks in advance for any and all replies.

Tom
You'll have to give us some more hints. Many of us here write macros that
work on both windows and Macintosh systems. Generally, there are few
problems. Stuff to watch out for: 1)use controls from the forms toolbar, the
others are activex controls which will not work. 2) don't hard code file
separators (":" vs. "\") use application.pathseparator instead.

I don't understand what "don't work on my office Mac." means. Do you get
compile errors? Do they run but produce the wrong results? What doesn't
happen that you think should happen. Provide some more detail and we can
help. What actions are you trying to record. Recording generally works fine
on the Mac. What version of Excel are you using? Opening and saving files is
usually the thing that does not have to be changed, it works fine provided
you don't hard code paths.
 
J

JE McGimpsey

tfoulsh said:
1.
I have some fairly detailed (and not very well written, my VBA being
well....basic to say the least) macros from Excel 2004 on XP. They
don't work on my office mac. At all. What stuff might I need to
change.

Excel 2004 doesn't run on XP - do you mean XL03?

WinXL00/02/03 is VBA6, while WinXL97 and all MacXL versions are VBA5, so
there are some functions that don't exist on the Mac (e.g., VBA's Round,
Join, Split).

ActiveX doesn't work on Macs (i.e., controls from the Control Toolbox -
use Forms controls instead). There are also a few subtle differences in
syntax, particularly method arguments for the GetOpenFileName and
GetSaveAsFileName functions - see Help.

Take a look at "Differences between Excel VBA for Windows and Excel VBA
for the Macintosh" in Mac XL/VBA Help.
2.
I thought I might just write them again. I would normally record bits
and pieces especially when unsure of code. I can't get lots of things
to record (the macro is blank or only shows the last operation). In
particular opening and saving files which is one thing I obviously have
to change in my old macros.

VBA help has a number of examples of the Open and SaveAs methods. If
that doesn't help, post a reply with the code you've got and what you're
trying to do.
 

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