Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default CATCH-22 won't let me save the file - Dave Peterson

And google is nice, too!!

Jason, Frederick wrote:

Dave,
Your are a the MASTER! Thank you. I have been pulling my hair out for the last 6 hours because no one on here really either understood the initial question or just had no clue.
The bottom line was, the code needed to be saved and that could not be done because the code was running.
Thank you for providing the "immediate window" and "application.enableevents = false" command thus allowing me to save the file blank.
Jason

Dave Peterson wrote:

CATCH-22 won't let me save the file
26-Mar-08

Before you (as the developer, not the user) save the file, you can turn off
events.

Open the VBE
hit ctrl-g to see the immediate window
type this and hit enter:
application.enableevents = false

Then save your workbook--the _beforesave event won't fire.

Then back to the VBE and toggle the setting in the immediate window:
application.enableevents = true

====
You could also do other stuff, too. Maybe check the username?

if lcase(application.username) = lcase("Patrick Riley") then
'do nothing, let it save...
'or clear that cell!
me.sheets("Main").range("e59").value = ""
else
If IsEmpty(me.Sheets("Main").Range("E59").Value) Then
MsgBox "You must type in your name before " & _
"this file can be saved.", 16, "ERROR"
Cancel = True
End If
end if

Patrick Riley wrote:

--

Dave Peterson

EggHeadCafe - Software Developer Portal of Choice
ASP.NET Session State FAQs
http://www.eggheadcafe.com/tutorials...state-faq.aspx


--

Dave Peterson
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
Trying to catch data from a EXCEL file jokobe Excel Discussion (Misc queries) 0 April 21st 08 07:43 PM
Excel Interop Catch Event for Saving a file as xls and as xml? m.ahrens Excel Programming 8 December 29th 04 02:11 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Catch FileSave/Save As/etc... Sonny Maou Excel Programming 4 February 23rd 04 09:47 PM


All times are GMT +1. The time now is 10:59 AM.

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

About Us

"It's about Microsoft Excel"