View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Alter macro security level programmatically

You may be able to adapt this to Access:

Sub is_it_safe()
Dim s As String
Dim s2 As String
s2 = "C:\temp\child1.xls /s"
s = "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe "
x = Shell(s & s2, 1)
End Sub

The idea is to open child1.xls in Excel in Office Safe Mode. This should
disable any child1 startup macro activity.
--
Gary''s Student - gsnu200764


"Dale Fye" wrote:

I have an Access application that is opening a number of Excel spreadsheets
and reading data from them. Each of these spreadsheets has the same macros,
which I want to disable when I open the workbook, rather than having to click
the pop-up window that asks if I want to enable/disable macros.

Is there a way to do this using Excel automation? How about using API
calls? My intent is that I would like to read the current setting, change
the setting to disable macros, read in the files, then reset the setting to
its original value.

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.