Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

I'm writing an automation project which involves extracting data from ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a few
questions.
First: The tools-macros-security tab has 4 values; why can I only set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Programmatically preventing macros issues

If I am understand your problem correctly...

Have you tried assigning a personal digital certtificate to your
project file/VBA application and setting the macro level to High in
Excel?

Microsoft office allows you to make digital certificates for just that
purpose - so you can be prompted before you accept running a macro
from an untrusted source only once (trust those you want - discard
those you don't - in this case you will be trusting your file and
disgarding the data source macros without the hassle of being
prompted).

To make a certificate: Start Microsoft Office Office Tools
Digital Certificates for VBA Projects

To apply it to your project file: In your VBA editor under tools
Digital Signature

....I think this is what you were asking and is one way to go about
trying to work around security.

Good Luck.

-Eric

On Sat, 7 Oct 2006 08:45:20 -0400, "Lew" wrote:

I'm writing an automation project which involves extracting data from ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a few
questions.
First: The tools-macros-security tab has 4 values; why can I only set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programmatically preventing macros issues

If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the information
in the clipboard.

You can suppress this with DisplayAlerts or you can copy an individual cell
to the clipboard before closing the workbook.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I'm writing an automation project which involves extracting data from
ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a
few
questions.
First: The tools-macros-security tab has 4 values; why can I only set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

Thanks, Eric:
No, we're automating data extraction into corporate data stores. The dev
platform is Visual FoxPro and we're not running any macros. Sorry if I
wasn't clear enough.
-Lew
"Eric Lachowitz" wrote in message
...
If I am understand your problem correctly...

Have you tried assigning a personal digital certtificate to your
project file/VBA application and setting the macro level to High in
Excel?

Microsoft office allows you to make digital certificates for just that
purpose - so you can be prompted before you accept running a macro
from an untrusted source only once (trust those you want - discard
those you don't - in this case you will be trusting your file and
disgarding the data source macros without the hassle of being
prompted).

To make a certificate: Start Microsoft Office Office Tools
Digital Certificates for VBA Projects

To apply it to your project file: In your VBA editor under tools
Digital Signature

...I think this is what you were asking and is one way to go about
trying to work around security.

Good Luck.

-Eric

On Sat, 7 Oct 2006 08:45:20 -0400, "Lew" wrote:

I'm writing an automation project which involves extracting data from
ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a
few
questions.
First: The tools-macros-security tab has 4 values; why can I only
set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

Guess I didn't say enough. The data is being pulled out by my VFP code into
corporate data stores. This allows us to have a single platform for pulling
from a large variety of sources ... (text, word, excel, ftp stuff, etc...)
-Lew
"Tom Ogilvy" wrote in message
...
If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the information
in the clipboard.

You can suppress this with DisplayAlerts or you can copy an individual
cell to the clipboard before closing the workbook.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I'm writing an automation project which involves extracting data from
ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a
few
questions.
First: The tools-macros-security tab has 4 values; why can I only
set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programmatically preventing macros issues

I guess that would mean you using ADO.

If your using ADO, then you don't start the excel application and you should
not get any prompts except for errors.

--
Regards,
Tom Ogilvy

"Lew" wrote in message
...
Guess I didn't say enough. The data is being pulled out by my VFP code
into corporate data stores. This allows us to have a single platform for
pulling from a large variety of sources ... (text, word, excel, ftp stuff,
etc...)
-Lew
"Tom Ogilvy" wrote in message
...
If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the
information in the clipboard.

You can suppress this with DisplayAlerts or you can copy an individual
cell to the clipboard before closing the workbook.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I'm writing an automation project which involves extracting data from
ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a
few
questions.
First: The tools-macros-security tab has 4 values; why can I only
set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to
disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else)
could
trigger a dialog requiring user input & resulting in an apparent hang?
If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

Hi Tom:
VFP uses the excel com interface. I can grab an existence of the
excel.application object if one exists in the desktop environment or create
one if necessary, so I'm using the excel internals to get at the data, not
ADO (unless, of course, excel itself uses ADO to manage its own data).
-Lew

"Tom Ogilvy" wrote in message
...
I guess that would mean you using ADO.

If your using ADO, then you don't start the excel application and you
should not get any prompts except for errors.

--
Regards,
Tom Ogilvy

"Lew" wrote in message
...
Guess I didn't say enough. The data is being pulled out by my VFP code
into corporate data stores. This allows us to have a single platform for
pulling from a large variety of sources ... (text, word, excel, ftp
stuff, etc...)
-Lew
"Tom Ogilvy" wrote in message
...
If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the
information in the clipboard.

You can suppress this with DisplayAlerts or you can copy an individual
cell to the clipboard before closing the workbook.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I'm writing an automation project which involves extracting data
from ss
we receive from a bewildering number of sources, and we're afraid of
the
possibility that my app may trigger a malicious macro. I understand
that
I've got to set the AutomationSecurity value to 3, but I've still got a
few
questions.
First: The tools-macros-security tab has 4 values; why can I only
set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to
disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else)
could
trigger a dialog requiring user input & resulting in an apparent hang?
If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programmatically preventing macros issues

Then the original answer was appropriate.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
Hi Tom:
VFP uses the excel com interface. I can grab an existence of the
excel.application object if one exists in the desktop environment or
create one if necessary, so I'm using the excel internals to get at the
data, not ADO (unless, of course, excel itself uses ADO to manage its own
data).
-Lew

"Tom Ogilvy" wrote in message
...
I guess that would mean you using ADO.

If your using ADO, then you don't start the excel application and you
should not get any prompts except for errors.

--
Regards,
Tom Ogilvy

"Lew" wrote in message
...
Guess I didn't say enough. The data is being pulled out by my VFP code
into corporate data stores. This allows us to have a single platform for
pulling from a large variety of sources ... (text, word, excel, ftp
stuff, etc...)
-Lew
"Tom Ogilvy" wrote in message
...
If you are using the clipboard and have a large amount of data, when
you attempt to close the file you could get a prompt to retain the
information in the clipboard.

You can suppress this with DisplayAlerts or you can copy an individual
cell to the clipboard before closing the workbook.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I'm writing an automation project which involves extracting data
from ss
we receive from a bewildering number of sources, and we're afraid of
the
possibility that my app may trigger a malicious macro. I understand
that
I've got to set the AutomationSecurity value to 3, but I've still got
a few
questions.
First: The tools-macros-security tab has 4 values; why can I only
set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to
disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else)
could
trigger a dialog requiring user input & resulting in an apparent hang?
If
yes, will DisplayAlerts = false take care of this? Please bear in mind
that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!



--
-Lew
The workers took the robot for Maria.











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

I don't understand. The original answer was about digital certificates and
writing macros in vba. We are *not* using either one.


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programmatically preventing macros issues

Not my original answer.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I don't understand. The original answer was about digital certificates and
writing macros in vba. We are *not* using either one.





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Programmatically preventing macros issues

Eric in which version of Office was this introduced?
TIA

"Eric Lachowitz" wrote:

If I am understand your problem correctly...

Have you tried assigning a personal digital certtificate to your
project file/VBA application and setting the macro level to High in
Excel?

Microsoft office allows you to make digital certificates for just that
purpose - so you can be prompted before you accept running a macro
from an untrusted source only once (trust those you want - discard
those you don't - in this case you will be trusting your file and
disgarding the data source macros without the hassle of being
prompted).

To make a certificate: Start Microsoft Office Office Tools
Digital Certificates for VBA Projects

To apply it to your project file: In your VBA editor under tools
Digital Signature

....I think this is what you were asking and is one way to go about
trying to work around security.

Good Luck.

-Eric

On Sat, 7 Oct 2006 08:45:20 -0400, "Lew" wrote:

I'm writing an automation project which involves extracting data from ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a few
questions.
First: The tools-macros-security tab has 4 values; why can I only set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Programmatically preventing macros issues

Sorry, I thought you meant the original answer to my post from Eric
Lachowitz. If the following is your original answer:

If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the information
in the clipboard.
You can suppress this with DisplayAlerts or you can copy an individual cell
to the clipboard before closing the workbook.

I remain at a loss. We're not using the clipboard, but we will be closing
files that we open. However, they will remain unchanged and should not
trigger a file save dialog.

Can you tell me anything about the excel AutomationSecurity property? For
instance, why are there 4 settings on the tools-macro-Security Level tab
whereas I can only set the property to 1, 2 or 3?

Thanks for your patience.

"Tom Ogilvy" wrote in message
...
Not my original answer.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I don't understand. The original answer was about digital certificates and
writing macros in vba. We are *not* using either one.





  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programmatically preventing macros issues

xl2000/xl2002, only have three values that I can see.

I don't have xl2003 installed right now to check

the automationsecurity setting allows you to enable or disable macros for a
file your code is opening (or to let it default to the user selected
security setting). It doesn't allow you to change the users settings. It
allows you to overide them for your macro.

Can your macro trigger a dialog - sure, the setting has nothing to do with
that. Application.DisplayAlerts will work with the same dialogs it works
with in VBA. Not all dialogs are suppressed by displayalerts.

--
Regards,
Tom Ogilvy



"Lew" wrote in message
...
Sorry, I thought you meant the original answer to my post from Eric
Lachowitz. If the following is your original answer:

If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the information
in the clipboard.
You can suppress this with DisplayAlerts or you can copy an individual
cell
to the clipboard before closing the workbook.

I remain at a loss. We're not using the clipboard, but we will be closing
files that we open. However, they will remain unchanged and should not
trigger a file save dialog.

Can you tell me anything about the excel AutomationSecurity property? For
instance, why are there 4 settings on the tools-macro-Security Level tab
whereas I can only set the property to 1, 2 or 3?

Thanks for your patience.

"Tom Ogilvy" wrote in message
...
Not my original answer.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I don't understand. The original answer was about digital certificates
and writing macros in vba. We are *not* using either one.







  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Programmatically preventing macros issues

Same with xl2003 (only 3 settings).

Maybe xl2003's help will help the OP:

MsoAutomationSecurity can be one of these MsoAutomationSecurity constants.

msoAutomationSecurityByUI Uses the security setting specified in the Security
dialog box.

msoAutomationSecurityForceDisable Disables all macros in all files opened
programmatically without showing any security alerts.

msoAutomationSecurityLow Enables all macros. This is the default value when the
application is started.




Tom Ogilvy wrote:

xl2000/xl2002, only have three values that I can see.

I don't have xl2003 installed right now to check

the automationsecurity setting allows you to enable or disable macros for a
file your code is opening (or to let it default to the user selected
security setting). It doesn't allow you to change the users settings. It
allows you to overide them for your macro.

Can your macro trigger a dialog - sure, the setting has nothing to do with
that. Application.DisplayAlerts will work with the same dialogs it works
with in VBA. Not all dialogs are suppressed by displayalerts.

--
Regards,
Tom Ogilvy

"Lew" wrote in message
...
Sorry, I thought you meant the original answer to my post from Eric
Lachowitz. If the following is your original answer:

If you are using the clipboard and have a large amount of data, when you
attempt to close the file you could get a prompt to retain the information
in the clipboard.
You can suppress this with DisplayAlerts or you can copy an individual
cell
to the clipboard before closing the workbook.

I remain at a loss. We're not using the clipboard, but we will be closing
files that we open. However, they will remain unchanged and should not
trigger a file save dialog.

Can you tell me anything about the excel AutomationSecurity property? For
instance, why are there 4 settings on the tools-macro-Security Level tab
whereas I can only set the property to 1, 2 or 3?

Thanks for your patience.

"Tom Ogilvy" wrote in message
...
Not my original answer.

--
Regards,
Tom Ogilvy


"Lew" wrote in message
...
I don't understand. The original answer was about digital certificates
and writing macros in vba. We are *not* using either one.






--

Dave Peterson
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Programmatically preventing macros issues

I am unsure as to when... I am running 2003 (but I think that office
tool has been around for a while)

On Sat, 7 Oct 2006 17:35:01 -0700, Graham Y
wrote:

Eric in which version of Office was this introduced?
TIA

"Eric Lachowitz" wrote:

If I am understand your problem correctly...

Have you tried assigning a personal digital certtificate to your
project file/VBA application and setting the macro level to High in
Excel?

Microsoft office allows you to make digital certificates for just that
purpose - so you can be prompted before you accept running a macro
from an untrusted source only once (trust those you want - discard
those you don't - in this case you will be trusting your file and
disgarding the data source macros without the hassle of being
prompted).

To make a certificate: Start Microsoft Office Office Tools
Digital Certificates for VBA Projects

To apply it to your project file: In your VBA editor under tools
Digital Signature

....I think this is what you were asking and is one way to go about
trying to work around security.

Good Luck.

-Eric

On Sat, 7 Oct 2006 08:45:20 -0400, "Lew" wrote:

I'm writing an automation project which involves extracting data from ss
we receive from a bewildering number of sources, and we're afraid of the
possibility that my app may trigger a malicious macro. I understand that
I've got to set the AutomationSecurity value to 3, but I've still got a few
questions.
First: The tools-macros-security tab has 4 values; why can I only set
the AutomationSecurity value to 1, 2 or 3 (ie only 3 possible values)?
Second: If I set AutomationSecurity to 3 and, since we plan to disable
user interaction with excel while my app is running by making excel
invisible, is there any possibility that a macro (or anything else) could
trigger a dialog requiring user input & resulting in an apparent hang? If
yes, will DisplayAlerts = false take care of this? Please bear in mind that
the only thing we're doing (as of now anyway) is pulling values out of
cells, not anything that I see as requiring interaction.
Other suggestions or things to watch out for?
TIA!


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
Preventing users from changing macros JS101 Excel Discussion (Misc queries) 2 February 9th 09 11:54 PM
preventing macros from clearing the undo list John Davies Excel Programming 2 January 13th 06 04:57 PM
Disable Macros in workbook programmatically quartz[_2_] Excel Programming 2 April 2nd 05 03:31 AM
preventing disabling of macros Combo[_2_] Excel Programming 0 October 9th 03 12:46 AM
Parametrized Macros preventing other macros sundar Excel Programming 1 August 18th 03 02:06 PM


All times are GMT +1. The time now is 09:40 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"