Thread: red "X" disable
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default red "X" disable

Great, glad it worked!
__________________________________________________ _______________________

"pswanie" wrote in message
...
thats exactly what i needed!!!

thanx...



"Vasant Nanavati" wrote:

Also, my mistake, sorry. Should be:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
__________________________________________________ _______________________


"pswanie" wrote in message
...
nope no expert at all.... so i will skip the API thingie

i tried that but it gave me an error...

this is wat i did

with the workbook open i right click on the green thingie on left top
coner
view code
paste


Public fMacro As Boolean

Private Sub Workbook_BeforeClose()
If Not fMacro Then Cancel = True
End Sub

and then in my macro that save and print and quit

change

ActiveWorkbook.Save
Application.Quit

to this
ActiveWorkbook.Save
ThisWorkbook.fMacro = True



this did not work.