+ Reply to Thread
Results 1 to 4 of 4

VBA for 64-bit and 32-bit

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    VBA for 64-bit and 32-bit

    Hi,

    Below is code that works on 64-bit. I know by switching the LongLong's to Long and removing PtrSafe it works on 32-bit, but I'm wondering how to write this to work on both?

    Please Login or Register  to view this content.
    Last edited by yawnzzzz; 08-02-2010 at 08:55 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: VBA for 64-bit and 32-bit

    Good evening yawnzzzz

    Not tested, nor can I test it as I don't have Excel 2010 however I think you're going to need two versions of the macro: one for 32 bit and one for 64 bit. You will need to read the Application.Version value to see what the user is running and run the appropriate version.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: VBA for 64-bit and 32-bit

    From what I've gathered, this should work:

    Please Login or Register  to view this content.
    But I'm not sure about the correct syntax for this:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: VBA for 64-bit and 32-bit

    I just surrounded it like the above, and it appears to work. I thought there might be a simpler solution though.

    Please Login or Register  to view this content.

+ 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