PDA

View Full Version : Excel for MAC crashes



CruellBuell
12-05-2007, 02:51 PM
Hello out there,

I have built some VB code to manipulate data . For maintenance purposes I hav put the code in one workbook, and the data and buttons referring to the macros in another.

On windows this works fine (from win95/office 97 up to XP / office 2003)

Running the same pair on a MAC (Office 2004 for Max, OS 10.4) results in a crash. not immediately, but as it seems as soon as the code containing book saves itselves.

from then on it just starts up ans crashes on every action that calls a macro.:banghead:
When in debug mode, is suddenly (meaning at unknown event) states "Data invalid" won't show the VB code anymore and crashes on next occasion

simply opening the book on windows ans saving it solves the problem, for a while...
(books stored on a network drive, but local copies suffer the same problem)

it looks as if the code is overwriten?

: pray2: HELP anyone with a hint (or solution )

tpoynton
12-05-2007, 05:30 PM
Welcome!

There's a Mac forum here just for these sorts of questions - I'd suggest posting the code there.

Have you tried compiling on the Mac? sometimes that will highlight errors for you. Posting the code will help you get the best help.

mikerickson
12-05-2007, 11:20 PM
Post the code. An unsupported feature in the Workbook_Open would be where I started looking.


(Excel 2004, OS 10.5)

CruellBuell
12-06-2007, 12:10 AM
thanx.
I put the question at MAC (did not see that)

Mikerickson: there are no event handlers in my code such as _open, _close etc.
TPoynton: Compiling either shows nothing or "data invalid" without highlighting a piece of code.

I didn't put code here because there is a lot of code, and no suspicious part ...

mikerickson
12-06-2007, 12:39 AM
brainstorming / guessing:

Are the controls ActiveX? not supported on Mac.

I don't see how the missing Split, Join, Replace and other functions could cause that behaviour.

If your code does file handeling that could be a problem.

Shell functions, etc. refer to Windows OS.

An unlikely problem might be Mac doesn't support default properties for custom Classes.

CruellBuell
12-06-2007, 01:02 AM
As said, on windows it works flawless, so it must be statements MAC related. That I agree. But It does work9See below), thus ActiveX is not the case. As for the shell functions, I am not shure. Many functions I am using without even knowing where they're from. All file, and screen specific functions are double coded, one for windows, one for MAC. printing works same for both.

It only saves and opens the other (data) workbook. For that a OS dependend separator is added (slask or ":") I use no options for workbook save

Shell functions, etc. refer to Windows OS.
An unlikely problem might be Mac doesn't support default properties for custom Classes.

Might very well be. I have included all enumerations explicitly as constants etc.
Saillant detail: it all works fine until the workbooks are saved, I have used all macro's tens of times without any malfunction (ahum, sort of, I mean with regards to this problem). The data workbook is saved by the functions before maniplating routines. The data workbooks seem to remain intact. no visual (data inspection) or functional disbehaviour. Then I thougth to have solved the problem, closed excel, and after reopening it crashes as described.


As far as the problem now seems:
I have password protected the code file as read only, and flagged the workbook.saved frequently (at ever termination of a user transaction) as true. It is more or less stable, but it is a terrible workaround. It makes maintenance awkward, I don't want to release this way. But it sketches the nature of the problem

figment
12-06-2007, 07:02 AM
check the object calls, from my experiance the mac tends to only suport the plural form of them, thus .Cells works but .Cell does not, and so on for workbooks, Worksheets, ext.

mikerickson
12-06-2007, 07:24 AM
Modeless userform?

I've noticed that 2004 will ignore errors in userform code. It's almost like every Userfom code module is in a On Error Resume Next. Simple errors that would get the DeBug screen in 98, will cause 2004 to close and try to call Cuppertino.

I've also had problems when copying a worksheet that has code in its module. (Worksheet.Copy)

Do you have a copy of 98 that you can try it on. 98 seems stable-er than 2004, it might error in debuggable way rather than the bad crash you are currently dealing with.

CruellBuell
12-06-2007, 07:50 AM
thanx again .:friends:
will dig 98 up somewhere, my lady has a MAC archive, thus...
as far as i know I use plurals always. Will code-walktrough on it anyhow, mistypes that work(s) are killing..

PS I did not notice before, but
If I store the code-containing workbook with windows / Office 2003 in the network drive, its size is 750 k. After the MAC/Office 2004 has saved it, the size is reduced to 580k !!! From then on the errors occur. It looks like not all of the workbook is saved on disk. It is not a network problem, the error also occurs on a stand alone MAC