Unwanted "beeps" during macro when it minimizes the Adobe window

  • I have code that opens adobe files, copies their content, and pastes it into a range in Excel. It works OK, but as it cycles through the Adobe files, one at a time, every time it minimizes the Adobe window to get back to Excel, during:


    SendKeys ("%n"), True


    it beeps. (I've isolated this portion of the macro through trial and error, this is the code that triggers the beep) This gets annoying when there are several files to load.


    Is there some VBA code to turn off the audible beep sound during a macro? Or another way to set the focus back to Excel so the data can be pasted, instead of minimizing the Adobe window?


    I don't want to turn down the volume, in case there are other non-related alerts or notifications that need attention afterward.

    Respectfully,


    Jerry


    "An infinite number of me would never type Shakespeare; Douglas Adams, maybe..."

  • SendKeys should be avoided.


    I never use them so I'm not sure what you are trying yo and one line of code doesn't help.


    Please read the Forum Rules before replying. The rules will explain how to use the Forum and why I have added code tags for you.

  • Thanks for the reply. I am not a new member, I am the original jerry12302 but had to create a new account since I lost my password, and I no longer have the original email address for recovery purposes.


    • Member since Jan 7th 2008
    • Last Activity: Nov 9th 2011

    Posts 6 Points 20 Trophies 1 Profile Hits 5


    I didn't want to post the entire code, since I don't have a problem with the code itself, only the SendKeys line is relevant.


    I use SendKeys to select and copy the pdf file content because I learned that process from hundreds of other users, including experts from this forum, over several years. Do you know of another way to grab content from a pdf file? I have searched many forums, and all over the internet, and have not found any other code to accomplish this.


    I just presumed that others who use SendKeys have also been getting these annoying beeps, and maybe someone learned how to avoid them.


    Thanks for looking though.

  • This should only be used as a last resort as it is not 100% secure and relies on the user not interrupting the macro.

    That line of code doesn't produce a beep on my computer.

  • This gets a little complicated, the send keys here

    Code
    SendKeys ("%n"), True

    Use to close Adobe, or minimize (something like that), not sure why this code causes a bleep sound


    Can you double check this is correct


    jiuk

  • Yes, Jack, thanks for your reply, that is the syntax I used. The beeps are annoying, and I don't know if it's an Excel thing, or a Windows 7 thing.


    I did eliminate them by opening the speakers mixer options and sliding the "system sounds" down to 0, and leaving the "speakers" volume where I usually set it when I play music in the background.


    I wish I could figure out code to run to do this automatically.

  • Something I played around with years and years ago - kind of got it working, sorry I can not locate the xls I have all the testing in


    jiuk


  • Jack,


    Brilliant!


    I played around with this, the mute does mute the speakers, and the volume up turns them back up.


    Oddly, if you call mute again, it toggles the volume back up.


    In any event, this seems to do the trick.


    Thanks for the code, I could not find an answer anywhere.


    Jerry

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!