Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    SendKeys question

    I have a few macros that use the SendKeys command to automatically say YES when a pop-up asks if a file should be overwritten. These macros have worked fine for years.

    I just put a new PC in place and all my macros are functioning correctly on the new install except that the SendKeys command is not working and I'm having to click YES to overwrite a saved file during an automatic SAVEAS command. Not a huge problem of course but I'd like to get it resolved.

    Is there some feature I've missed turning on in Excel in order for SendKeys to work in the marco? That's the only thing I can think of that could be causing this change in the way the macro runs.

    Thanks,
    BH

  2. #2
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post
    Resolved. I just eliminated the SendKeys command and added Application.DisplayAlerts = False.
    Thanks,
    BH


    Application.DisplayAlerts = False
    ' SendKeys "{Y}"
    ActiveWorkbook.SaveAs Filename:="D:\MS OFFICE DOCUMENTS\INVOICES\PACK_SLIP.xls", _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,822
    Thanks
    134
    Thanked 481 Times in 458 Posts
    ..a better solution!

    zeddy

Posting Permissions

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