|
-
Apr 20th, 2005, 11:17 PM
#1
Thread Starter
Addicted Member
Application.OnKey prblm in Excel 2003
I have this small piece of vba code in ThisWorkbook object:
Private Sub Workbook_Open()
Application.OnKey "%{z}", "OptionListBox"
End Sub
Private Sub OptionListBox()
Userform1.Show
End Sub
What it does is the user can press Ctrl-z at any moment to launch a form from my workbook. Easy enough.
Everything is kosher except that, if I save the workbook (WB1) under a new name (WB2), then press ctrl-z, it loads the previous file(WB1) and runs the code from there. In other word, the call is being make from that old file.Grrr..
Ive tried to incorporate some With ActiveWorkbook in some key places in the code, but no success whatsoever.
I don't know how to attach this to a specific file, can't I run two instances for seperate workbooks on my screen?
Can anyone help me plz?
Thanx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|