Run Macro from Windows Hotkey

NagaThom

New Member
Joined
Jun 12, 2008
Messages
4
So I have a new job and a coworker that makes this really annoying teeth sucking sound like every 2 minutes, so the only I stay sane is by keeping track of every time he does it. I have made a spreadsheet to keep track, and it's keeping me sane like a charm. (link to file)

I would like log each event by just hitting "F12" (or something), without opening the Excel window, rather than having to open the spreadsheet and clicking the button to run the macro. I've been searching for 2 days, but I can't find any instructions for doing this.

I was thinking it might be possible using a VBScript file that I could then associate to a hotkey, but I have no experience with these. I would like to be able to run the macro only when the sheet is already open, and it would be nice if the sheet stayed under whatever I was working on at the time.

Any suggestions? Thanks!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
alternatively (because I think what you're asking is pretty difficult to put together quickly) what about just running a NETSEND to his machine each time he does it with some appropriate remark ...
 
Upvote 0
What about putting some code in your personal macros. Assign it to a short cut key.

Some code like
workbooks("the one you want to update").whatever

I didn't open the linked file. Can you code what you want? If not, can you describe in words what you want?
 
Upvote 0
I have already assigned the code to a shortcut key, but I would like to be able to run the code from any program without having to open the excel window. No, I'm not a golfer... ?
 
Upvote 0
You can write a vbs file, put a shortcut to it on your desktop, then assign a shortcut key to the shortcut by right-clicking it and choosing Properties. The script can be as simple as:
Code:
dim objExcel
on error resume next
set objExcel = getobject(,"excel.application")
objexcel.run "personal.xls!mymacro"
 
Last edited:
Upvote 0
Rorya-
Your code worked perfectly! I knew it was something really simple like that.

On a related note, where would you recommend I read up on VBScript coding?

Thanks so much!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top