+ Reply to Thread
Results 1 to 10 of 10

PtrSafe error for Inserting Sound File

  1. #1
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    PtrSafe error for Inserting Sound File

    Dear Friends,

    I am trying to insert a sound file with the help of below mentioned code (apparently I found this code from this forum itself) however I am getting error message "The code in this project must be updated for use on 64-bit systems. Please review and update Declare Statements and then mark them the PtrSafe attribute."

    Any kind of help is highly appreciated


    Please Login or Register  to view this content.
    Attached Images Attached Images
    Regards,
    Little Master

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi,

    click the help button … Or see the PtrSafe example within the VBA inner help as all is yet there.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,563

    Re: PtrSafe error for Inserting Sound File

    Marc L - the OP has come to us for help. Please don't refer them back to Help files. If you don't wish to help in a thread, then just ignore it, please. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: PtrSafe error for Inserting Sound File

    Thank You Marc for the suggestion, I tried checking help section, however did not understand much as I am noob in this. Any kind of help from any expert is highly appreciated.

    Thanks AliGW for empathizing with my situation...really appreciate this.

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: PtrSafe error for Inserting Sound File

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: PtrSafe error for Inserting Sound File

    Thank You Kenneth, before posting in this forum for help, I tried the solution mentioned in the microsoft link, however still getting error.Error2.JPG
    Attached Images Attached Images

  7. #7
    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 error for Inserting Sound File

    If you've put that in anything other than a normal module, add the word Private before both instances of Declare in that code.
    Remember what the dormouse said
    Feed your head

  8. #8
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: PtrSafe error for Inserting Sound File

    Rory, thanks a ton for reply, however it didn't help either.

    Error 4.JPG

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,912

    Re: PtrSafe error for Inserting Sound File

    Try this then.

    On opening the example file you'll see all your wav-files listed in Column A.

    Select a sound and click the button.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    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 error for Inserting Sound File

    Didn't help in what sense? If you're still getting the same error, then it's not because of that code.

+ 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. Sound File Playing Twice
    By ballz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2017, 12:26 PM
  2. Sound file in Excel
    By lotusman in forum Excel General
    Replies: 5
    Last Post: 11-08-2017, 05:37 PM
  3. [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
  4. [SOLVED] Error inserting picture with wildcard in file name
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2014, 04:27 PM
  5. Replies: 2
    Last Post: 02-18-2013, 10:17 AM
  6. Play Sound File
    By Soniya in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2006, 06:50 AM
  7. [SOLVED] can VBA be used to sound a *.wav file on condition(s)?
    By J_J in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-23-2005, 04:06 PM

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