Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Disable auto open


I have a workbook that has code to update files. the file is manipulated and
presented. I need to disable the auto open code. I had code to ask if you
want to update the file however the users wanted that to go away after the
report was formatted.

I added the if isnull code to prevent the update from occuring and did not
realize I disabled the code that would prevent an update.

I need to disable the Auto_Open code before the contents are erased.

or can someone tell me how to save the contents of the workbook and get rid
of the code?

I have tried to change macro settings does not seem to work.

Held shift key does not work...same with Ctrl break...


Sub Auto_Open()

If IsNull(Cells(1, 2)) Then
Answer = MsgBox("Would you like to update this file?", vbYesNo +
vbExclamation, "UPDATE FILE?")
If Answer = 7 Then Exit Sub
End If

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


Range("a1:bk1000").Select
Selection.ClearContents
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Disable auto open


If I follow, in the open event you want to do something if not already done,
but if aleady done early exit without bothering the user. One idea -

Sub auto_open()
Dim nm As Name

On Error Resume Next
Set nm = ThisWorkbook.Names("Prelim")
On Error GoTo 0

If Not nm Is Nothing Then
If UCase(nm.RefersTo) = "=TRUE" Then Exit Sub
End If

' do stuff here
Range("A1").Value = "Prelim stuff"

If Not nm Is Nothing Then nm.Delete
' store a flag in a name
Set nm = ThisWorkbook.Names.Add("Prelim", "=True")
nm.Visible = False ' hide the name

End Sub

Regards,
Peter T

"Rpettis31" wrote in message
...
I have a workbook that has code to update files. the file is manipulated
and
presented. I need to disable the auto open code. I had code to ask if
you
want to update the file however the users wanted that to go away after the
report was formatted.

I added the if isnull code to prevent the update from occuring and did not
realize I disabled the code that would prevent an update.

I need to disable the Auto_Open code before the contents are erased.

or can someone tell me how to save the contents of the workbook and get
rid
of the code?

I have tried to change macro settings does not seem to work.

Held shift key does not work...same with Ctrl break...


Sub Auto_Open()

If IsNull(Cells(1, 2)) Then
Answer = MsgBox("Would you like to update this file?", vbYesNo +
vbExclamation, "UPDATE FILE?")
If Answer = 7 Then Exit Sub
End If

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


Range("a1:bk1000").Select
Selection.ClearContents



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
Auto Open + Disable on Final Product THE_RAMONES Excel Programming 2 November 25th 08 06:34 PM
Disable auto-update Jamal Excel Programming 1 January 5th 08 01:21 AM
Can I disable auto formula update? jch New Users to Excel 4 August 9th 05 06:31 PM
Disable Auto Macro mike_cutting-edge[_2_] Excel Programming 1 February 15th 05 03:07 AM
Disable auto editor formatting Niklas[_3_] Excel Programming 1 August 14th 03 12:51 PM


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