+ Reply to Thread
Results 1 to 4 of 4

PtrSafe not working

  1. #1
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    PtrSafe not working

    Hi all, i just migrated to 64 bit, and received a message stating i need to ptrsafe to all declare statements.

    After a bit of research, I did this, and this is the only change made. eg, i changed:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Now when i try run the addin i get a message to say there is a problem with the addin and excel just shuts down again unless i disable the addin.

    Any ideas ?

    I am running win10 64bit and o365 64bit
    ***------ Coding for Fun ------***

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,291

    Re: PtrSafe not working

    Can't you just use Environ("username") and remove the API call completely?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: PtrSafe not working

    Hey, I could, but its not the only function i need to update. That said, i found solution. I also have to add ptr to each long

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,291

    Re: PtrSafe not working

    You shouldn't. The declaration as posted was correct for 64 bit. Neither nSize nor the return value are handles or pointers, so they don't need to be LongPtr.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PtrSafe error for Inserting Sound File
    By Little Master in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-27-2019, 03:00 PM
  2. Replies: 1
    Last Post: 08-30-2017, 02:32 AM
  3. Replies: 1
    Last Post: 02-27-2016, 06:28 PM
  4. Replies: 3
    Last Post: 05-14-2015, 07:32 AM
  5. [SOLVED] PtrSafe attribute for 64 bit system
    By MissDB in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 04-08-2014, 05:43 AM
  6. Replies: 4
    Last Post: 09-03-2013, 02:52 AM
  7. Replies: 2
    Last Post: 08-17-2012, 08:16 AM

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