Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default open file macros inactive

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default open file macros inactive

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default open file macros inactive

Barb,

Wouldn't this affect my main file macros? I need to open the second file
with macros inactive... will below do it and still keep my master file macros
active. Please calrify.

"Barb Reinhardt" wrote:

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default open file macros inactive

Really the right word I should have used for what I need is macro disable.

"Barb Reinhardt" wrote:

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default open file macros inactive

If you do this

Application.AutomationSecurity = msoAutomationSecurityForceDisable

Your macros will stop altogether.

Just try it and step through the code to see if it works. I guarantee it
will. You won't get an enable macro message and any workbook open code that
you have will not run.

Isn't that what you want?





"Alberto Ast" wrote:

Really the right word I should have used for what I need is macro disable.

"Barb Reinhardt" wrote:

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default open file macros inactive

Thanks Barb.. it did open with macros disable but my initial macro where I
open the file stop there after opening a file... it did not perform the rest
of the macro... how do I enable it again so it will continue.

Thanks,

"Barb Reinhardt" wrote:

If you do this

Application.AutomationSecurity = msoAutomationSecurityForceDisable

Your macros will stop altogether.

Just try it and step through the code to see if it works. I guarantee it
will. You won't get an enable macro message and any workbook open code that
you have will not run.

Isn't that what you want?





"Alberto Ast" wrote:

Really the right word I should have used for what I need is macro disable.

"Barb Reinhardt" wrote:

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default open file macros inactive

I removed all the Application.Automa..... comand lines I previously posted so
for now the macro will finish all the way but it acts as if I had not removed
the Applicaion.AutomationSecu..... command... it open the file and then
stop... I have this

Sub OpenFile()
Workbooks.Open Filename:="MyFile.xls", ReadOnly:=True
Workbooks("MyFile.xls").Close savechanges:=False
Windows("File_with_original_macro.xls").Activate
End Sub



"Barb Reinhardt" wrote:

If you do this

Application.AutomationSecurity = msoAutomationSecurityForceDisable

Your macros will stop altogether.

Just try it and step through the code to see if it works. I guarantee it
will. You won't get an enable macro message and any workbook open code that
you have will not run.

Isn't that what you want?





"Alberto Ast" wrote:

Really the right word I should have used for what I need is macro disable.

"Barb Reinhardt" wrote:

Put this around your workbook open code

Application.AutomationSecurity = msoAutomationSecurityLow
'Workbook open code
Application.AutomationSecurity = msoAutomationSecurityByUI

HTH,
Barb Reinhardt

"Alberto Ast" wrote:

I need to open a file read only and macros inactive.

I know how to do read only but how to do macros inactives?

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
Open file with macros David T Excel Discussion (Misc queries) 2 November 29th 07 06:23 PM
Not allow to open file it do not accept macros JR_06062005[_2_] Excel Programming 1 February 15th 06 01:52 PM
Open file without macros John Excel Programming 4 July 21st 05 10:48 PM
In VBA, Open a file with macros disabled Otto Moehrbach[_6_] Excel Programming 1 October 24th 04 11:44 PM
How can I have a macros automatically run when I open up the file. Owen[_2_] Excel Programming 2 September 30th 04 01:44 AM


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