Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Test for Mac version (Excel 97/2000/2002)

    How can I go about testing if my workbook is being opened in Excel for Mac? In the 3 yrs I've been doing Excel VBA projects I haven't come across users who tried to run my workbooks with a Mac. Now in the last 3 weeks I've had two people contact me saying "it doesn't work." It didn't initially occur to me to ask them if they were running on a Mac or not. Usually I just ask what version of Excel they have.

    All my projects have VBA in them so they can open the workbook but none of the code works, the buttons do nothing, no automation. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    Is there something at workbook open I can check for that tells me it's a Mac OS? On the other hand, if it is Mac OS and VBA doesn't work then I can't exactly pop up a message and tell them it won't work? <img src=/S/doh.gif border=0 alt=doh width=15 height=15> <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Never mind, dumb question ... can't be solved I guess. So a plain no-VBA workbook is transferrable between Win and Mac but not one with VBA. That's the lesson learned.

    Deb

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    The current version of Office for the Mac, v.X, hosts VBA. I wasn't pleased about the editor, as MS omitted the intellisense and autocomplete features (actually, I'm not sure of the real names of these features, but you probably know what I'm getting at). I'm not sure about earlier versions.

    Maybe your users can give you some help?
    <hr>Note Some elements of the Office object models (both the Macintosh and Windows versions) depend on the operating system. If you have difficulty running VBA code, see Visual Basic Help in your installation of Office for Macintosh-specific information. mactopia Developer Resources<hr>
    The first thing I would check would be the References dialog in the Mac application's VB Editor. Pointing the critical libraries to their correct locations might be all that's needed.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Dim bMacOS as Boolean
    Dim bMacX as Boolean
    If Application.OperatingSystem Like "*Mac*" Then
    bMacOS = True
    If Val(Application.Version) >= 10 Then bMacX = True
    Else
    bMacOS = False
    End If
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Since I don't have a Mac and have never used one, can you tell me exactly what keystrokes or menus a Mac user would use to provide me with the info I need (the list of references)? <img src=/S/help.gif border=0 alt=help width=23 height=15> I have two people at work who can't use the workbook. My project doesn't do any file manipulation or any OS specific stuff, it just reads/writes to and from cells and has some pop-up forms that are activated from buttons. I have code in lots of workbook and worksheet events.I've tested it on Excel 2000 and Excel 2002 so far.

    One user can open the file but the buttons do nothing. The other claims a KERNEL32.DLL error and Excel crashes. I don't know if this last person is a Mac user or not. At least 20 other people have tested my project so far and these two are the only ones who report such severe errors.

    I'll send them a small .xls with the code written by lounger pieterse to see if they can execute that ok. That way I know if they can run something or not. I'm pretty sure none of my 'real' end users will have a Mac as they're all financial analysts but these people are tech writers who are working on a developing a Flash tutorial of the tool.

    Thnx, Deb

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    If I remember correctly (been a few months), to open Office for Mac's VBE, it's basically the same as Office for Windows:

    Tools > Macro > Visual Basic Editor or Tools > Macro > Macros, select one and click Edit

  6. #6
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    aaah, but none of my macros show in that list because they're either private or I trick the public ones into not displaying (I don't want users to randonly pick one to run on their own). Also, my project is protected. I guess I can ask them to launch Excel on its own and go into the editor and tell me what they see for references.

    I'll call the one person locally and try and walk them through it. It seems the menu method is the same at least (of course Alt-F11 won't work).

    Thnx, Deb <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    I think the References are template specific, so if you want to know whether they are flagged MISSING (etc.), they will need to open your template. Maybe if you post a stripped out version here, I can drop by the Apple store, browse to the Lounge, and test it myself? <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Your code can test whether it is running on a Mac.

    However, you might better first see what VBA you are using that won't work on a Mac.

    If you limit yourself to Excerl 97 VBA, then there's a good chance the code will work on the Mac.
    If you use any of the additions in VBA 6 (used by Excel 2000) or VBA 6.3 (Excel 2002), then the code will not work on the Mac as all Mac Office versions use a subset of VBA 5.

    Of course, if you are using Windows API calls, then the code will not run on the Mac.

  9. #9
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Thanks for the advice. I'm not using any of the additions as you mentioned. I never add any extra references to my projects since I don't want to deal with having to install those on the end user's platform. No Win API calls either. <img src=/S/pcvmac.gif border=0 alt=pcvmac width=137 height=30>

    I need to send my one local Mac user (he's not an end user of the tool but has a Mac to try it on) an uprotected copy of my project so they can tell me what the references list shows. I always try and make it work with xl97 first and then 2000/2002.

    I'll try to get some time with him face to face as I don't want to send him an unprotected copy of my project. <img src=/S/nope.gif border=0 alt=nope width=15 height=15>

    Deb

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    I'd suggest going to a local place that rents time on Macs, e.g., in the USA, there's Kinko's.

    Revealing the code and/or working via a 3rd party are less desirable.

  11. #11
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Great idea! I never thought of using the Macs at Kinko's. I'll do that - hopefully I find one hidden in a corner so no one sees me fumbling around trying to figure out how to use it <img src=/S/hiding.gif border=0 alt=hiding width=70 height=24>

    Deb <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    A few years ago, I investigated using a Mac at the local Kinko's.

    1. In preparation, I purchased 2 O'Reilly books. One was titled something like Crossing Platforms, which showed corresponding Windows and Mac stuff. The other was specific to a Mac OS, I forget which.

    2. You need to verify that the local Kinko's allows debugging/use of macros. I had to show them a source code listing. They stared at it, pretending they knew what was going on, I could see the confusion in his face.

    I would not depend on the Kinko's personnel. I'd depend on books.

  13. #13
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    This sounds like they have either macro security set to high, or to medium and then disable macros at load. The first situation prevents XL from running macros and gives no prompt for them either. Clicking any button has no effect.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  14. #14
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    One thing you should do is send them a quickee test, source and all, to see if th have VBA disabled.

    A simple Userform with two control butons is a good test.
    Click one button and you display time of day and date on the userform.
    Click other button to go bye bye.

  15. #15
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Test for Mac version (Excel 97/2000/2002)

    Today I was able to sit face-to-face with one of the Mac users who couldn't run my Excel 2k project. I had sent him a very simple file with one macro (the one provided by another poster that uses msgbox to display the OS). I attached it to a button a worksheet. This Mac had OS 9.2.2 and Excel 4. Macros were enabled but clicking the button didn't do anything.

    I the tried to view it in the VBA editor but when I tried to view the project I got "project locked, project not viewable" message. What?? <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15> <img src=/S/cranky.gif border=0 alt=cranky width=18 height=25> <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

    The file definitely was not protected in any way but the Mac Excel wouldn't let me view it. Is there some big compatibility void between Windows Excel 2000 and Mac Excel 4?

    I then created a simple .xls file on the Mac with code in a sheet's activate() event. It just had msgbox ("hello") and that's it. It ran fine on the Mac and also on the Windows PC.

    I couldn't find any Security menu like I see in Excel 2000 so I'm guessing Mac Excel 4 is more like Excel 97 (or earlier). I also couldn't check the resources since I couldn't get into the project.

    Fortunately the 'real' end users of the tools I write are financial types, financial planners, CxO, etc. and the odds that they're using a Mac are quite slim. These Mac folks were tech writers and a graphic designer who needed to review the tool for other reasons. I ended up making screen shots of everything and sent them a PDF.

    So any ideas on why this simple experiment failed miserable? <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15>

    Thnx, Deb

Page 1 of 2 12 LastLast

Posting Permissions

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