Excel Macro Problem

H

HLP

I just upgraded my Mac to Office 2004. I am trying to open some older
Excel files that were created on a PC that have Macros in them. The
opened fine in Office X. They open fine but when I close the Excel
file it says the Excel has unexpectedly quit. It asks if I want Excel
to try to recover the file and restart Excel. I deselect that option,
but the next time I open Excel it automaticaly opens that file again
that caused it to quit. Then I get stuck in a circle of opening Excel,
it opens the file, I quit the file, Excel crashes. I get out of the
cycle by throwing away Excel prefs but then anytime I try to open any
of these PC files with Macros in them it does it again. I have tried
this on two separate Macs and it does the same thing. Any suggestions?

Thanks
 
J

JE McGimpsey

I just upgraded my Mac to Office 2004. I am trying to open some older
Excel files that were created on a PC that have Macros in them. The
opened fine in Office X. They open fine but when I close the Excel
file it says the Excel has unexpectedly quit. It asks if I want Excel
to try to recover the file and restart Excel. I deselect that option,
but the next time I open Excel it automaticaly opens that file again
that caused it to quit. Then I get stuck in a circle of opening Excel,
it opens the file, I quit the file, Excel crashes. I get out of the
cycle by throwing away Excel prefs but then anytime I try to open any
of these PC files with Macros in them it does it again. I have tried
this on two separate Macs and it does the same thing. Any suggestions?

First, after a crash, you should be asked if you want to open the
file(s) that were open when the crash occurred - clicking on Do Not Open
should allow you to open XL without cycling. You can also start XL with
the Shift key down.

Sometimes code modules (especially if they've been edited frequently)
get corrupted, which can cause crashes. If you have access to a PC, you
can run Rob Bovey's Code Cleaner:

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

You can do the same thing manually in MacOffice by opening the file with
the Shift Key down. Open the VBE. For each module, copy the text (I copy
all but the last letter, but that's superstition), and paste it into a
text editor (if you use TextEdit, be sure to be in plain text mode).
Delete the module, create a new one, copy the text from the text editor
and paste it into the new module. In most cases, before I ship an
application, I create a new workbook, and transfer any code in the
ThisWorkbook or Worksheet code modules, as well as the regular modules,
via the text editor.

If that doesn't solve the problem, check for BeforeClose or
Workbook_Deactivate event macros. If they exist, try setting a
breakpoint at the first step and close the workbook - the step through
the code to see if you can tell where the quit is coming from.
 

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