+ Reply to Thread
Results 1 to 6 of 6

vba code to run autohotkey script

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    vba code to run autohotkey script

    i wan to use a vba code to run a autohotkey script at K:\filepath\studing.ahk
    i used the following code but it brings up the debugger:
    Please Login or Register  to view this content.
    please help

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,090

    Re: vba code to run autohotkey script

    Total guess and untested, but try:

    Please Login or Register  to view this content.
    Or even
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


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

    Arrow Re: vba code to run autohotkey script


    Try adding double double-quotes for the program too …

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: vba code to run autohotkey script

    thank you Marc L and TMS, it was the "" quotes!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,090

    Re: vba code to run autohotkey script

    You're welcome. Thanks for the rep.


    Did you need more or less double quotes?

  6. #6
    Registered User
    Join Date
    09-29-2012
    Location
    Sun City West, AZ
    MS-Off Ver
    Excel 2010
    Posts
    1

    Thumbs up Re: vba code to run autohotkey script

    Thanks to all on this thread. Your posts provided just what I needed to leverage ahk scripting with some of my Excel vba routines.

    NOTE 1: the "" is required on both sides of the fully qualified path \scriptname.ahk

    NOTE 2: the ("………….") are required to fully enclose the SHELL path\scriptname

    NOTE 3: In vba, Breaking a shell command line with " _" is NOT allowed!

    Vba example follows:

    Sub Test()
    Shell ("C:\Program Files\AutoHotkey\AutoHotkey.exe ""C:\Users\Wayne\Software Installed\Auto Hotkey - AHK\AHK Scripts\test.ahk""")
    End Sub

    The above routine is called by an Excel sheet \ button to which the linked Sub is assigned.
    Tested - OK 9/5/2020
    Last edited by wddogger; 09-05-2020 at 07:47 PM. Reason: grammar

+ 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. [SOLVED] FolderPath_Password in given cells instead of vba script/code
    By RavindraK in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-05-2019, 07:30 AM
  2. [SOLVED] Modify Highlight Row Script/Code
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2018, 12:26 AM
  3. Insert VBA code in a SAP script
    By MHarrisC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2016, 12:41 AM
  4. VBA script to override current code 'when needed'
    By HP RodNuclear in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2012, 12:00 PM
  5. HELP!! Newbie, Need help writing code/script
    By Omit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2012, 02:59 AM
  6. Script & VBA Code download an FTP file
    By howard101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2010, 05:34 PM
  7. Perl script to create CSV files. How to add vba code ?
    By turbo75 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2007, 08:41 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