Results 1 to 15 of 15
  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

    Mac VBA vs. Windows VBA (Excel 2002)

    Hi all,
    I write a lot of Excel VBA custom apps and very occasionally have a Mac user who always has problems running these files (the huge majority of my users have Windows). This current case is a user who is familiar with VBA with his Mac and is trying to work with me to figure out what's wrong. He has the latest Mac OS and the latest Office Excel for Mac too.

    Since we don't work near each other it's not easy to collaborate on this real-time and I don't have access to a Mac either. I've searched all over for info on VBA in Excel on a Mac and found very little (other than something about it runs in a "VBA virtual machine"- is that true? and if so, then it probably explains the lack of compatibility)

    The problem he sees initially is a simple list box that I added to a worksheet (from the Controls tool box). On the Mac it complains about it but on a PC it's a built-in item (no references needed). I gave him the password to the project code so he can try and fix it himself (if it's possible) but that's not what I want to do for future versions of course.

    Does anyone have experience with Excel VBA on a Mac or know of good resources I could refer to?

    Thnx,
    Deb

  2. #2
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    I can't speak to Excel, but getting Word macros to work on a Mac can be a real challenge, and I assume the obstacles are similar. First, don't assume anything is built into Mac VBA -- case in point, there's no Split() function on Mac VBA, and Split() in VBA has been around for about 7 years. Second, get your hands on a Mac. The only way you'll be able to ensure your code wil come close to working on a Mac is to test it out. I'm sure you know someone with a Mac who would loan it to you for a day or two in exchange for a case of beer or something. Good luck!

  3. #3
    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: Mac VBA vs. Windows VBA (Excel 2002)

    I managed to find a Mac Excel MVP (found him on line in some Mac forum) that answered my immediate question. I was using a combo box from the Controls tool box and that's all ActiveX which isn't supported on a Mac. I'll use the Forms tool box instead (which in this one case is ok but will be a problem in other apps I do). He said there is no list of what's different for Mac VBA vs. Windows which is what I expected (hey there's no such list for VBA between versions of Windows Excel either and there are MANY differences!!).

    I don't know anyone who'd lend me their Mac but I'll find out if I really need to support these Excel apps on a Mac and if so, then management can do their thing and get me one for testing.

    Thnx, Deb

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,265
    Thanks
    2
    Thanked 187 Times in 173 Posts

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    Hi Deb,
    If you do end up getting a Mac, you may wish to check out VirtualPC which will allow you to run Windows on your Mac so you can do all your development on one machine. There are also emulators that will allegedly allow you to run OS X on a PC.
    FWIW.
    Regards,
    Rory

    Microsoft MVP - Excel

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

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    last i checked, there are at least th refollowing issues:

    1. VBA on the MAC is still VBA 5 and is not even fully compatible with Office 97 VBA.
    2. thee are Mac/Windows differences, e.g., path separator, particular character codes and dateranges.

    One can get Mac time at a local Kinko's, or other such place.

  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: Mac VBA vs. Windows VBA (Excel 2002)

    Actually it is further along than xl97 if they have the newest Office. I also don't deal with paths or other 'external' things to Excel, just simple things like controls on sheets, code to auto-populate cells, display custom forms on certain events, etc.

    I wrote email to John Walkenbach (the oh-so-wise-Excel-VBA-wizard)- and he replied!!. Basically he said he avoids Excel/Mac for the same reasons that I mentioned to him. There just aren't enough users to justify anyone spending any $ documenting VBA for that limited audience.

    Thnx, Deb

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

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    dpes excel 2004 support modeless userforms, enums, replace/split/join functions, all the workbook/worksheet events?

    i disagree wit jw, i believe that there are enough users, the real question is whether an author wants to spend the time as the expected sale of additional books may be not so great.

    it's not all that hard to document the differences, IF one goes to the trouble of purchasing a mac to play with,
    i've not done much for the mac but, heck, if a client was large enough, i'd sure buy a mac to do the work.

  8. #8
    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: Mac VBA vs. Windows VBA (Excel 2002)

    So far what I've done works but I don't use any functions that aren't supported by Excel97 (that's my baseline that I use even when I program w/Excel 2002+). So far all the workbook/sheet events seem to work for what I've done in this current project. Over the years I've run into many problems writing one set of code that works in Excel97+ and have found many bugs. Same code works in one rev, works differently in another and w/o using any features that aren't in Excel 97. For example, protecting a workbook that's already protected causes the workbook to get unprotected!!! This is an error in xl2002/03+ but not xl97 or xl2000. It's not always the case that I know if the workbook is already protected, so I just had code that protected it anyway - <img src=/S/blowup.gif border=0 alt=blowup width=60 height=60> - this resulted in the workbook actually getting unprotected!! I didn't notice this had happened for quite a while.

    I'm trying to acquire a used Mac at work for testing purposes. I replaced the buttons, etc. I used from the Control Tool box with shapes I drew from the Drawing tool bar. I then just attached the same code that I ran from behind the regular buttons. So far so good...<img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Deb

  9. #9
    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: Mac VBA vs. Windows VBA (Excel 2002)

    I played with the VBE in Office.X Word at the Apple Store. No intellisense. No sale. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    But seriously, Microsoft has no incentive to establish parity between the platforms, and I suspect it never will. Perhaps this will create an opening for OpenOffice.org to become a significant player on the Mac?

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

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    If and only if they start implementing intellisense, that might just work. ANd then there is the matter of the missing documentation, there is no online help for oo BASIC on the object model at all. I have started porting one of my utilities to open office, just to start learning that development environment. I really don't like it. Intellisense is a tough one not ot have, as is no object model information.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  11. #11
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    Recently I did a project using Word 2004 for Mac 'cause a client insisted. It was an amazingly bad experience! - took me back to memories of Word 97, but far worse

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

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    Sounds like a fun experience indeed.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  13. #13
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    Just remembered one more oddity worth mentioning, in case it's ever useful to anyone else:

    When we started out developing the template, it was crashing literally every minute or two. In casting around for possible causes, I checked Tools > References. There was nothing unusual there, just the usual references to VBA, Word, MSForms, Microsoft Office etc. Out of desperation, I tested unchecking the reference to Microsoft Office (don't have the Mac here, so can't cite the actual library file name). It just so happened that my code did not require any reference to shared Office components.

    Making this change reduced the instance of crashing from every minute or two, to perhaps every half hour or so. No idea why doing this helped, but perhaps there is something buggy in the MS Office 2004 type library.

    Gary

  14. #14
    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: Mac VBA vs. Windows VBA (Excel 2002)

    Yes, the OpenOffice.org team seems much more interested in Java-based interfaces than in a VBA-like interface. I think they finally did post a manual for macro development (http://api.openoffice.org/DevelopersGuide/...opersGuide.html), but by the time that happened, I had moved on to other things... Maybe once I've finished my endless vacation photo editing, I can turn my attention back to Office-related stuff.

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

    Re: Mac VBA vs. Windows VBA (Excel 2002)

    I have all the documents I could get hold of that pertain to oo BASIC development, but none of them even comes close to a complete description of Objects, methods and properties. A good one is this one:
    http://www.openoffice.org/nonav/issues/sho...arBasicXref.sxw
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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