Consulting

Results 1 to 9 of 9

Thread: Excel for MAC crashes

  1. #1

    Exclamation Excel for MAC crashes

    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.
    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?

    HELP anyone with a hint (or solution )

  2. #2
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    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.

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Post the code. An unsupported feature in the Workbook_Open would be where I started looking.


    (Excel 2004, OS 10.5)

  4. #4
    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 ...
    Last edited by CruellBuell; 12-06-2007 at 12:52 AM.

  5. #5
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    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.

  6. #6
    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
    Last edited by CruellBuell; 12-06-2007 at 01:15 AM.

  7. #7
    VBAX Tutor
    Joined
    Aug 2007
    Posts
    273
    Location
    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.

  8. #8
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    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.
    Last edited by mikerickson; 12-06-2007 at 07:45 AM.

  9. #9
    thanx again .
    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
    Last edited by CruellBuell; 12-06-2007 at 08:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •