Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add not compiling
I created an add-in with some basic sub routines. I also have a sub
routine that I am using to assign shortcuts to the other subs. Sub OnKey() With Application ..OnKey "+^4", "fmtDollar" ..OnKey "+^5", "fmtPercent" ..OnKey "+^1", "fmtComma" ..OnKey "+^`", "fmtGeneral" End With End Sub The problem is that with the add-in loaded, when I open excel, the shortcut keys don't work. However, if I go into the code and hit F5 to compile it and then go back to my worksheet the shortcut keys work fine. Any ideas as to why I need to compile this everytime? Any help is greatly appreciated. Regards, Will |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add not compiling
Is there anything in the addin that would make this macro execute when the
addin is loaded. Just like any other workbook, if you want code to run, you have to trigger it. If you don't, then there's your huckleberry. -- Regards, Tom Ogilvy "will" wrote in message om... I created an add-in with some basic sub routines. I also have a sub routine that I am using to assign shortcuts to the other subs. Sub OnKey() With Application .OnKey "+^4", "fmtDollar" .OnKey "+^5", "fmtPercent" .OnKey "+^1", "fmtComma" .OnKey "+^`", "fmtGeneral" End With End Sub The problem is that with the add-in loaded, when I open excel, the shortcut keys don't work. However, if I go into the code and hit F5 to compile it and then go back to my worksheet the shortcut keys work fine. Any ideas as to why I need to compile this everytime? Any help is greatly appreciated. Regards, Will |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add not compiling
Seems to me your code (the OnKey... code) is in the wrong place. It'
there but it's not being run until you do it manually. I haven't don a whole lot of work with addins, but I do believe there should be a wa to trigget it with the Workbook_Open() event. Check into that and pos your results. - Piku -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add not compiling
I used the following to try to get it to "trigger", but it still isn't working.
Private Sub Workbook_Open() Call OnKey End Sub any other ideas? thx "Tom Ogilvy" wrote in message ... Is there anything in the addin that would make this macro execute when the addin is loaded. Just like any other workbook, if you want code to run, you have to trigger it. If you don't, then there's your huckleberry. -- Regards, Tom Ogilvy "will" wrote in message om... I created an add-in with some basic sub routines. I also have a sub routine that I am using to assign shortcuts to the other subs. Sub OnKey() With Application .OnKey "+^4", "fmtDollar" .OnKey "+^5", "fmtPercent" .OnKey "+^1", "fmtComma" .OnKey "+^`", "fmtGeneral" End With End Sub The problem is that with the add-in loaded, when I open excel, the shortcut keys don't work. However, if I go into the code and hit F5 to compile it and then go back to my worksheet the shortcut keys work fine. Any ideas as to why I need to compile this everytime? Any help is greatly appreciated. Regards, Will |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add not compiling
Private Sub Workbook_Open()
With Application ..OnKey "+^4", "fmtDollar" ..OnKey "+^5", "fmtPercent" ..OnKey "+^1", "fmtComma" ..OnKey "+^`", "fmtGeneral" End With End Sub I can't say that naming your procedure ONKEY is the problem, but I would avoid using that name. -- Regards, Tom Ogilvy "will" wrote in message m... I used the following to try to get it to "trigger", but it still isn't working. Private Sub Workbook_Open() Call OnKey End Sub any other ideas? thx "Tom Ogilvy" wrote in message ... Is there anything in the addin that would make this macro execute when the addin is loaded. Just like any other workbook, if you want code to run, you have to trigger it. If you don't, then there's your huckleberry. -- Regards, Tom Ogilvy "will" wrote in message om... I created an add-in with some basic sub routines. I also have a sub routine that I am using to assign shortcuts to the other subs. Sub OnKey() With Application .OnKey "+^4", "fmtDollar" .OnKey "+^5", "fmtPercent" .OnKey "+^1", "fmtComma" .OnKey "+^`", "fmtGeneral" End With End Sub The problem is that with the add-in loaded, when I open excel, the shortcut keys don't work. However, if I go into the code and hit F5 to compile it and then go back to my worksheet the shortcut keys work fine. Any ideas as to why I need to compile this everytime? Any help is greatly appreciated. Regards, Will |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compiling to one sheet | Excel Worksheet Functions | |||
Compiling to one sheet | Excel Worksheet Functions | |||
Compiling | Setting up and Configuration of Excel | |||
compiling? | Excel Programming | |||
Compiling a workbook... | Excel Programming |