Is there a way to have a file automaticallyopen a VBA macro on a PC but an AppleScript on aMac?

B

Basilisk

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Is there a way to have a file automatically open a VBA macro on a PC but an AppleScript on a Mac?

TIA
 
B

Bob Greenblatt

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Is
there a way to have a file automatically open a VBA macro on a PC but an
AppleScript on a Mac?

TIA
Yes! The macro just needs to be platform sensitive and act accordingly.
Given that you are using 2004 this may not be necessary, as the macros
should work fine on both a Mac and PC.
 
B

Basilisk

That's why we are still on 2004. But so far we haven't got any Macros from the files made on one of our PCs to work on the Mac. I suspect it may be to do with the filepath reference, which might also be causing another problem I posted about and which you have kindly responded to.

Where can I find how to make a macro platform sensitive, please?
 
B

Bob Greenblatt

That's why we are still on 2004. But so far we haven't got any Macros from the
files made on one of our PCs to work on the Mac. I suspect it may be to do
with the filepath reference, which might also be causing another problem I
posted about and which you have kindly responded to.

Where can I find how to make a macro platform sensitive, please?
You¹ll have to check out some of the Excel macro texts. The VBA statement
application.operatingsystem returns a string that shows the OS and version.
You code will have to test this and issue the appropriate instructions based
on the platform. Alternatively you could use conditional assembly to only
include the proper code for the platform.
 

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