+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Backwards Compatibility from a 64 Bit VBA Macro

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    Backwards Compatibility from a 64 Bit VBA Macro

    Hi All -

    I'm hoping someone can help me resolve this issue. I've looked high and low for a solution everywhere on various search engines and no one has a solution.

    Here's the scenario:

    I built a VBA Macro in Excel 2010 (64-bit) and saved it as an "XLS" (Excel 97 - 2003) file with the hopes that my clients can use the file on either 32 bit or 64 bit version of MS Excel (i.e. Excel 2003/2007). After building the macro, I realized that because I'm using userforms, I need to use the PtrSafe command to ensure that my macro works in Excel 2010.

    After building the macro, I gave it to my client who is using Excel 2007 (32 bit). Apparently, they're getting compile errors right when they open the macro. It has to do with the fact that the PtrSafe command is not recognized in Excel2007.

    How do I ensure that my 64 bit Excel 2010 macro has the proper code in place so it's backwards compatible for also Excel 2007 32 bit versions? I've read numerous articles and everyone is talking about the move from 32 bit to 64 bit tools, but not the other way.

    The code in question is the following:

    Please Login or Register  to view this content.
    Any help trying to resolve this is VERY much appreciated.
    Last edited by piyushdabomb; 02-27-2012 at 11:46 AM.

  2. #2
    Registered User
    Join Date
    02-22-2012
    Location
    Office
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    Hello there

    Because you searched already, maybe you know this:

    http://msdn.microsoft.com/en-us/library/ee691831.aspx

    Search for "Application Programming Interface Compatibility" on that page

    Will explain the compiler problems
    Last edited by inteq; 02-24-2012 at 04:37 PM.

  3. #3
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    Thanks, but it doesn't help.

    I'm surprised that I'm not getting more responses on this topic. Moderators, can you help?

    This is a BIG problem for anyone moving to the new Excel platform. Anyone help please?

  4. #4
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    So, what's the solution then?

  5. #5
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    I don't know since, as I said, they should not get errors there as the compiler should be ignoring that code. Are you 100% sure that that is the offending code?

    Side note: PtrSafe has nothing whatsoever to do with userforms as you suggest in your original post - it relates to API calls and memory addresses.
    Good luck.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    I just put your code in a 32 bit Excel 2010 module and no errors were noticed.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Backwards Compatibility from a 64 Bit VBA Macro

    The code compiles in 2007 too. Perhaps it is the fact that the syntax checker will turn it red that is confusing your users.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1