Excel macros developed on Mac in Excel v.X don't work on PC

P

Paul B

Hey,

I developed an Excel spreadsheet with some pretty extensive macros
written using the Visual Basic editor. I have code in a number of
modules, have a couple User Forms created, and activate code using
controls in the worksheets.

I sent the file to a PC running Windows XP, where every time I accessed
the file, Excel crashed. I then sent the file to another person I know
with a PC (not sure of the OS, but certainly a very recent Windows
release), who was able to open the file after Excel "repaired" it by
deleting all Visual Basic script from the entire file. The "repair" Excel on
her PC listed was "Lost Visual Basic Project."

Has anyone else had this problem? What would keep macros written on
a Mac from moving to PCs?

Thanks,

Paul
 
J

JE McGimpsey

Paul B said:
Hey,

I developed an Excel spreadsheet with some pretty extensive macros
written using the Visual Basic editor. I have code in a number of
modules, have a couple User Forms created, and activate code using
controls in the worksheets.

I sent the file to a PC running Windows XP, where every time I accessed
the file, Excel crashed. I then sent the file to another person I know
with a PC (not sure of the OS, but certainly a very recent Windows
release), who was able to open the file after Excel "repaired" it by
deleting all Visual Basic script from the entire file. The "repair" Excel on
her PC listed was "Lost Visual Basic Project."

Has anyone else had this problem? What would keep macros written on
a Mac from moving to PCs?

Nothing in MacXL VBA should cause a crash in WinXL. There are a few
functions (mostly dealing with File I/O) that use a different syntax and
should give a syntax error, but that's far from being a crash.

OTOH, with both WinXL and MacXL, editing modules can lead to their
getting a lot of garbage stored in them (invisibly) and corrupting.

The fix in WinXL is to use Rob Bovey's Code Cleaner:

http://www.appspro.com/Utilities/CodeCleaner.htm

The fix in MacXL is to copy all the text to a text editor (in plain text
mode), then paste it back into a fresh module, deleting the original.
Before I send any production applications out, I go one better and copy
everything (both worksheets and code) to a fresh workbook.
 
P

Paul B

Thanks for the reply. I will try that.

One question - How do you handle User Forms, some of which have
code attached to them?

Regards,

Paul
 
J

JE McGimpsey

Paul B said:
One question - How do you handle User Forms, some of which have
code attached to them?

I create a new form, do a CMD-A/CMD-C on the old form to copy all the
controls then paste it on the new form and change the new form's size
and caption, etc. The code I copy to a Text Editor then copy back to the
new form. Then I delete the old form.
 
J

Jim Gordon MVP

Hi,

There is a way to crash windows and that is to put a picture onto a
userform. Don't put pictures onto userforms if you plan to distribute
the workbook to windows users.

-Jim
 

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