ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Hotkey Strategy (https://www.excelbanter.com/excel-programming/349131-custom-hotkey-strategy.html)

Sprinks

Custom Hotkey Strategy
 
We have 50 or so macros, some of which have assigned hotkeys. Others are
available only through a custom menu (thanks, John Walkenbach!). Our boss,
however, prefers different hotkeys than the rest of us, so I created a 2nd
file for him which has different hotkey assignments, as well as different
Descriptions for the custom menu, e.g.,

Round to One Place (Ctrl-r)

I'd rather not maintain two files, however, so I thought of extending the
table that John W.'s code uses, adding columns for "Default HotKeys" and [the
boss' username]. The code could then read the appropriate hotkey assignments
depending on the username.

This strategy breaks down, however, on a laptop or home computer that he
might use that doesn't have the same (if any) username, which would cause the
macros to work differently than he expects.

What I'd like to do is:
- Determine if we're on the corporate network
- if so, use the username
- if not, present the user a combo box to select the hotkey setup

Can anyone point me in the right direction?

Sprinks


Tom Ogilvy

Custom Hotkey Strategy
 
try something like:

s = dir("\\server\folder\")
if s = "" then
' not on network
else
' on network
end if

You might need some error handling.
--
regards,
Tom Ogilvy

"Sprinks" wrote in message
...
We have 50 or so macros, some of which have assigned hotkeys. Others are
available only through a custom menu (thanks, John Walkenbach!). Our

boss,
however, prefers different hotkeys than the rest of us, so I created a 2nd
file for him which has different hotkey assignments, as well as different
Descriptions for the custom menu, e.g.,

Round to One Place (Ctrl-r)

I'd rather not maintain two files, however, so I thought of extending the
table that John W.'s code uses, adding columns for "Default HotKeys" and

[the
boss' username]. The code could then read the appropriate hotkey

assignments
depending on the username.

This strategy breaks down, however, on a laptop or home computer that he
might use that doesn't have the same (if any) username, which would cause

the
macros to work differently than he expects.

What I'd like to do is:
- Determine if we're on the corporate network
- if so, use the username
- if not, present the user a combo box to select the hotkey setup

Can anyone point me in the right direction?

Sprinks




Sprinks

Custom Hotkey Strategy
 
Thanks, Tom. That should do it.

Sprinks

"Tom Ogilvy" wrote:

try something like:

s = dir("\\server\folder\")
if s = "" then
' not on network
else
' on network
end if

You might need some error handling.
--
regards,
Tom Ogilvy

"Sprinks" wrote in message
...
We have 50 or so macros, some of which have assigned hotkeys. Others are
available only through a custom menu (thanks, John Walkenbach!). Our

boss,
however, prefers different hotkeys than the rest of us, so I created a 2nd
file for him which has different hotkey assignments, as well as different
Descriptions for the custom menu, e.g.,

Round to One Place (Ctrl-r)

I'd rather not maintain two files, however, so I thought of extending the
table that John W.'s code uses, adding columns for "Default HotKeys" and

[the
boss' username]. The code could then read the appropriate hotkey

assignments
depending on the username.

This strategy breaks down, however, on a laptop or home computer that he
might use that doesn't have the same (if any) username, which would cause

the
macros to work differently than he expects.

What I'd like to do is:
- Determine if we're on the corporate network
- if so, use the username
- if not, present the user a combo box to select the hotkey setup

Can anyone point me in the right direction?

Sprinks






All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com