Autohotkey - Run Excel Macro in Personal Workbook

Get help with using AutoHotkey and its commands and hotkeys
pete77

Autohotkey - Run Excel Macro in Personal Workbook

09 May 2017, 08:49

Hi,

The below works to run a macro in the current workbook

F11::
oExcel := ComObjActive("Excel.Application")
try oExcel.Run("Macro1")
return


I have tried many ways to get it to run a macro in the personal.xlsb but so far nothing works

I have tried the various threads found here

Please can some one help me see what the problem is

How can i run a macro stroed in the personal.xlsb

thank you
User avatar
jmeneses
Posts: 487
Joined: 28 Oct 2014, 11:09
Location: Catalan Republic

Re: Autohotkey - Run Excel Macro in Personal Workbook

10 May 2017, 01:01

works fine for me
Put a Msgbox in the macro to verify it
Donec Perficiam
User avatar
Jovannb
Posts: 220
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: Autohotkey - Run Excel Macro in Personal Workbook

10 May 2017, 10:43

Hi,

I learned to know, to if a (VBA-) macro e.g. modifies header or footer of a Excel-Sheet, than you need to use something like that

Code: Select all

	SetTitleMatchMode, 2		; Excel-Title can contain
	WinActivate, %xlsfile%		; go to current Excel-Sheet
	send !{F8}					; call macro-Dialog
	send %macro_name%{return}	; run that macro
otherwise the macro wont run correctly.

Give it a try, probably it helps.

J.B.
AHK-Release 1.1.30.03 Ansi 32-bit, Win10 (1903 18362.295) 64-bit, german
FanaticGuru
Posts: 1359
Joined: 30 Sep 2013, 22:25

Re: Autohotkey - Run Excel Macro in Personal Workbook

10 May 2017, 11:15

pete77 wrote:Hi,

The below works to run a macro in the current workbook

F11::
oExcel := ComObjActive("Excel.Application")
try oExcel.Run("Macro1")
return


I have tried many ways to get it to run a macro in the personal.xlsb but so far nothing works

I have tried the various threads found here

Please can some one help me see what the problem is

How can i run a macro stroed in the personal.xlsb

thank you
Like this:

Code: Select all

F11::
oExcel := ComObjActive("Excel.Application")
try oExcel.Run("PERSONAL.XLSB!Macro1")
return
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

[Function] Timer - Create and Manage Timers

Return to “Ask For Help”

Who is online

Users browsing this forum: Bort P, flyingDman and 210 guests