Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Workbook_Beforesave getting breached

Hi,

I have a workbook in which workbook_beforesave sub is run. The file doesnt
save if there is some internal data inconsistency. ( For example a
particular column is supposed to have only inetegers so if something else is
entered the file will not save).

I notice that once I enter data in it and do a "Save as" instead of save the
beforee save sub still works to my satisfaction.

But, suppose I enter some gibberish data and use the "Send to mail
recepientnt as attachment" then excel saves a temporary file ( having
inconsistent data) and attaches it to my Lotus Notes 5.

I just wanted to understand why this happens.

Also, is there any way may prevent this ( If it doesnt involve
elaborate/abtruse coding I will be greatful to include it as a part of the
existing code.)

Regards,
Hari
India





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Workbook_Beforesave getting breached

Hi Hari;

If you change to the BeforeClose method it should overcome
your issue I think. They may close it without saving it
but if the they have made changes to the workbook it will
automatically get interrogated before they get prompted to
do the save or save as.

Thanks,

Greg
-----Original Message-----
Hi,

I have a workbook in which workbook_beforesave sub is

run. The file doesnt
save if there is some internal data inconsistency. ( For

example a
particular column is supposed to have only inetegers so

if something else is
entered the file will not save).

I notice that once I enter data in it and do a "Save as"

instead of save the
beforee save sub still works to my satisfaction.

But, suppose I enter some gibberish data and use

the "Send to mail
recepientnt as attachment" then excel saves a temporary

file ( having
inconsistent data) and attaches it to my Lotus Notes 5.

I just wanted to understand why this happens.

Also, is there any way may prevent this ( If it doesnt

involve
elaborate/abtruse coding I will be greatful to include it

as a part of the
existing code.)

Regards,
Hari
India





.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Workbook_Beforesave getting breached

Hi Gjones,

Nopes, Doesnt work.

I opened a new workbook "Book3". Saved it on my desktop. Then I made changes
in it.

When I press the cross button on the righthand corner it prompts me with the
Msg "Pls save the workbook". { Please see my code at the end }.

But if I use Send to Mail receipient as attachment without saving the
changes made then excel sends my file to Lotus Notes.

It seems that along with workbook_beforesave , workbook_beforeclose can also
be breached.
( Thanx a lot to u. I didnt know about before close event. I learned
something new from u.)

Regards,
Hari
India.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ActiveWorkbook.Saved = False Then
Cancel = True

MsgBox "Pls save the workbook"
End If

End Sub





"Gjones" wrote in message
...
Hi Hari;

If you change to the BeforeClose method it should overcome
your issue I think. They may close it without saving it
but if the they have made changes to the workbook it will
automatically get interrogated before they get prompted to
do the save or save as.

Thanks,

Greg
-----Original Message-----
Hi,

I have a workbook in which workbook_beforesave sub is

run. The file doesnt
save if there is some internal data inconsistency. ( For

example a
particular column is supposed to have only inetegers so

if something else is
entered the file will not save).

I notice that once I enter data in it and do a "Save as"

instead of save the
beforee save sub still works to my satisfaction.

But, suppose I enter some gibberish data and use

the "Send to mail
recepientnt as attachment" then excel saves a temporary

file ( having
inconsistent data) and attaches it to my Lotus Notes 5.

I just wanted to understand why this happens.

Also, is there any way may prevent this ( If it doesnt

involve
elaborate/abtruse coding I will be greatful to include it

as a part of the
existing code.)

Regards,
Hari
India





.



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
HELP!!!! Calling a sub from Workbook_BeforeSave RocketMan[_2_] Excel Discussion (Misc queries) 4 May 31st 07 11:47 PM
ThisWorkbook.Save not working under Workbook_BeforeSave, Help! Michel[_3_] Excel Programming 4 May 30th 04 06:49 PM
Workbook_BeforeSave Bill Oertell Excel Programming 5 December 21st 03 07:33 PM
Workbook_BeforeSave() in xla Bent Kjeldsen Excel Programming 6 September 24th 03 01:49 PM


All times are GMT +1. The time now is 10:14 PM.

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"