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 "{ENTER}" in Macro...............Permission denied

    I've just put together a new Windows 8 PC to replace my Windows XP Home computer.

    After loading Office XP I've found that my macros containing SendKeys "{ENTER}" come to a screeching halt when that line is reached. The macros work fine otherwise.

    I get the message "Permission denied" when that line in the macro is reached.

    I've tried going to Excel.exe in File Explorer and changing permissions and security settings to suggestions I've found on the web to no avail.

    I've also read there could be some issues with newer versions of Visual Basic

    I'm logged in as an administrator on this single user desk top computer.

    I need to find a work around for this as it's a critical part of my spread sheet. It's worked just fine for years on the XP machine.

    Can anyone suggest an alternative to the SEND KEYS command or a way to get by this permissions problem?

    Code below:


    Sheets("COD").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("HALF ROUNDS").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("ELLIPTICALS").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("JAMBS").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("CROWNS").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("SPECIES").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("DRIP CAP").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete
    Sheets("INCH TO FOOT").Select
    SendKeys "{ENTER}"
    ActiveWindow.SelectedSheets.Delete

    Thanks,
    BH Davis

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    How about something like this without the sendkeys? [I presume that they are there to acknowledge the alert. This code just eliminates the alerts]
    Code:
    Application.DisplayAlerts = False
    Sheets("COD").Delete
    Sheets("HALF ROUNDS").Delete
    Sheets("ELLIPTICALS").Delete
    Sheets("JAMBS").Delete
    Sheets("CROWNS").Delete
    Sheets("SPECIES").Delete
    Sheets("DRIP CAP").Delete
    Sheets("INCH TO FOOT").Delete
    Application.DisplayAlerts = True
    Steve

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


    THANKS !!!!

    I see now that turning off the DISPLAY ALERTS was the key. I'm pretty much a novice and so REALLY appreciate the help.

    Take care,
    BH

Posting Permissions

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