Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro security issue

Excel 2000. I have wkbUtils.xla with an auto-signed certificate, Excel
Security on High.

wkbUtils.xla opens at Excel startup and Workbook_Open runs, creating
an on-the-fly command bar with an msoControlPopup control. I loop
through one of the modules' CodeModule Property to find the names of
all the subs there and place in an array, vProcs(). Back on the
msoControlPopup I then add an msoControlButton for each each of the
subs in vProcs(), with the following OnAction:

.OnAction = "'wkbUtils.Runner " & """" & vProcs(i) & """" & "'"

As you can see, instead of calling each sub directly, I call
wkbUtils.Runner, passing the sub name to it. Runner then brings up a
userform with various controls allowing the user to set options and
then click "Run" to start the macro. It also contains a progress bar.

The problem is, when I have Security set to high, and click one of the
msoControlButtons, it won't run wkbUtils.Runner. It's as if because
I'm adding another level of "calling" to the mix, it doesn't recognize
that Runner is in a trusted, certified workbook (in fact, the same
workbook that it already ran code from).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro security issue

It works if security is at medium? I had heard that along about SP3 of
xl2000 (as I recall) and later versions of Excel, this undocumented
convention for passing an argument to an onaction macro was not supported.
Maybe it has to do with the security setting.

--
Regards,
Tom Ogilvy


"Ladislav Ligart" wrote in message
om...
Excel 2000. I have wkbUtils.xla with an auto-signed certificate, Excel
Security on High.

wkbUtils.xla opens at Excel startup and Workbook_Open runs, creating
an on-the-fly command bar with an msoControlPopup control. I loop
through one of the modules' CodeModule Property to find the names of
all the subs there and place in an array, vProcs(). Back on the
msoControlPopup I then add an msoControlButton for each each of the
subs in vProcs(), with the following OnAction:

.OnAction = "'wkbUtils.Runner " & """" & vProcs(i) & """" & "'"

As you can see, instead of calling each sub directly, I call
wkbUtils.Runner, passing the sub name to it. Runner then brings up a
userform with various controls allowing the user to set options and
then click "Run" to start the macro. It also contains a progress bar.

The problem is, when I have Security set to high, and click one of the
msoControlButtons, it won't run wkbUtils.Runner. It's as if because
I'm adding another level of "calling" to the mix, it doesn't recognize
that Runner is in a trusted, certified workbook (in fact, the same
workbook that it already ran code from).



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro security issue

It works only at Low, and I'm at SP3.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro security issue

Follow up:

I found that if I removed the parameter passing, my wkbUtils.Runner
proc is called even with security on High:

fails .OnAction = "'wkbUtils.Runner " & """" & vProcs(i) & """"
& "'"
works .OnAction = "wkbUtils.Runner"

So it's the parameter that's messing things up.

Other tidbit:

With the parameter in Runner, "wkbUtils.Runner" doesn't show in
Alt+F8. But when I remove it, it does show:

no show Public Sub Runner(ProcToRun As String)
shows Public Sub Runner()

So it seems Excel views macros with parameters somehow differently.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro security issue

It doesn't really see them differently. You can't click on a macro that
requires an argument and hit run, which is pretty much wat the Alt+F8
approach is designed to do - so excel doesn't make them visible in the list.

--
Regards,
Tom Ogilvy

"Ladislav Ligart" wrote in message
om...
Follow up:

I found that if I removed the parameter passing, my wkbUtils.Runner
proc is called even with security on High:

fails .OnAction = "'wkbUtils.Runner " & """" & vProcs(i) & """"
& "'"
works .OnAction = "wkbUtils.Runner"

So it's the parameter that's messing things up.

Other tidbit:

With the parameter in Runner, "wkbUtils.Runner" doesn't show in
Alt+F8. But when I remove it, it does show:

no show Public Sub Runner(ProcToRun As String)
shows Public Sub Runner()

So it seems Excel views macros with parameters somehow differently.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security Issue: Data Connections Disabled Katara Excel Discussion (Misc queries) 0 March 8th 07 10:59 AM
Excel 2002 Security Issue PA New Users to Excel 2 December 3rd 05 02:32 PM
Security Issue rnieland Excel Programming 2 May 27th 04 11:31 PM
Sheet construction on server security issue Jim McLeod Excel Programming 1 April 21st 04 01:41 PM
macro - security issue Mary[_6_] Excel Programming 2 October 24th 03 05:18 PM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"