Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ActiveWorkbook.Save DOESNT WORK !!

Any ideas why a workbook Save method would fail to actually save without
raising any errors? Just after, the "Saved" property remains FALSE (at least
that much makes sense) - but I have no ideas what to look for / verify.

TIA!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default ActiveWorkbook.Save DOESNT WORK !!

Hi Slintz,

In the VBE, select the workbook's ThisWorkbbook module and look for a
Workbook_BeforeSave code something like:


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel
As Boolean)
'possible code lines

Cancel = True <<==== LOOK FOR THIS

'possible additional cde

End Sub

The marked line, as might intuitively be expected, cancels any save
operation,

---
Regards,
Norman



"slintz" wrote in message
...
Any ideas why a workbook Save method would fail to actually save without
raising any errors? Just after, the "Saved" property remains FALSE (at
least
that much makes sense) - but I have no ideas what to look for / verify.

TIA!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default ActiveWorkbook.Save DOESNT WORK !!

Hi Slintz.

Without knowing, what you are doing, possibly, hopefully, I am wrong but...

Wording like:

then un-twiddling and forcing the Saved property to TRUE


causes a nagging concern.

If you set the Saved property to true, the workbook will not save, because
the Excel accepts believes the Save to have been effected already.

As I said, I may well be wrong but, especially in the light of your
experience, the Save operation and setting Save =True do not immediately
strike me as likely bedfellows.

Just a thought...

---
Regards,
Norman



"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the Saved
property to TRUE). My event sub dutifully dis-ables events before the
doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...
THANX!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ActiveWorkbook.Save DOESNT WORK !!

Good idea AND still not working... <grrr

In fact, the Save method is being fired from within Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the Saved
property to TRUE). My event sub dutifully dis-ables events before the doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at... THANX!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default ActiveWorkbook.Save DOESNT WORK !!

And my first thought, tho I'm not a *real* coder, was ... are you disabliing
events? I don't think you should be.
*******************
~Anne Troy

www.OfficeArticles.com


"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the Saved
property to TRUE). My event sub dutifully dis-ables events before the

doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...

THANX!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveWorkbook.Save DOESNT WORK !!

If the OP is doing a SAVE within the BeforeSave Event as he seems to
indicate, then you certainly should disable events. unless you want to have
recursive events occuring.

--
Regards,
Tom Ogilvy


"Anne Troy" wrote in message
...
And my first thought, tho I'm not a *real* coder, was ... are you

disabliing
events? I don't think you should be.
*******************
~Anne Troy

www.OfficeArticles.com


"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within

Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the

Saved
property to TRUE). My event sub dutifully dis-ables events before the

doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...

THANX!




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default ActiveWorkbook.Save DOESNT WORK !!

Apologies for my clock glitch.

Trying to change regional settings and (mistakenly) believing that I can,
successfully, perform multiple tasks simultaneously.


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Slintz.

Without knowing, what you are doing, possibly, hopefully, I am wrong
but...

Wording like:

then un-twiddling and forcing the Saved property to TRUE


causes a nagging concern.

If you set the Saved property to true, the workbook will not save, because
the Excel accepts believes the Save to have been effected already.

As I said, I may well be wrong but, especially in the light of your
experience, the Save operation and setting Save =True do not immediately
strike me as likely bedfellows.

Just a thought...

---
Regards,
Norman



"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within
Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the
Saved
property to TRUE). My event sub dutifully dis-ables events before the
doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...
THANX!





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveWorkbook.Save DOESNT WORK !!

Let's say I want to hide sheets, save the workbook, unhide sheets as a form
of security - to prevent the workbook being saved with the sheets unhidden.
this will all be done in the beforesave. Since his code explicitly saves
the workbook before setting the Saved property, there should be no reason it
wouldn't work in doing the initial save. However, the Cancel property
should be set to true to prevent the initiating save action. I don't
believe setting the Saved property prevents saving - it prevent the prompt
to save.

--
Regards,
tom Ogilvy



"Norman Jones" wrote in message
...
Apologies for my clock glitch.

Trying to change regional settings and (mistakenly) believing that I can,
successfully, perform multiple tasks simultaneously.


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Slintz.

Without knowing, what you are doing, possibly, hopefully, I am wrong
but...

Wording like:

then un-twiddling and forcing the Saved property to TRUE


causes a nagging concern.

If you set the Saved property to true, the workbook will not save,

because
the Excel accepts believes the Save to have been effected already.

As I said, I may well be wrong but, especially in the light of your
experience, the Save operation and setting Save =True do not immediately
strike me as likely bedfellows.

Just a thought...

---
Regards,
Norman



"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within
Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle some
stuffs just before saving, saving, then un-twiddling and forcing the
Saved
property to TRUE). My event sub dutifully dis-ables events before the
doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...
THANX!







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default ActiveWorkbook.Save DOESNT WORK !!

Hi Tom ,

I totally agree with your comments.

I guess that my, admittedly speculative, concern related to a possible
scenario like:

Me.Saved = True
Me Close

However, looking again at the OP's initial post I see:

Just after, the "Saved" property remains FALSE


Which puts my speculation where it deserves to go.

The speculation was fuelled by the fact that, except for the Cancel = True
(my first guess) I have never seen a workbook evince the signs of saving
and yet quietly not do so.

Thank you and apologies for the delay in reponding.


---
Regards,
Norman


"Tom Ogilvy" wrote in message
...
Let's say I want to hide sheets, save the workbook, unhide sheets as a
form
of security - to prevent the workbook being saved with the sheets
unhidden.
this will all be done in the beforesave. Since his code explicitly saves
the workbook before setting the Saved property, there should be no reason
it
wouldn't work in doing the initial save. However, the Cancel property
should be set to true to prevent the initiating save action. I don't
believe setting the Saved property prevents saving - it prevent the prompt
to save.

--
Regards,
tom Ogilvy



"Norman Jones" wrote in message
...
Apologies for my clock glitch.

Trying to change regional settings and (mistakenly) believing that I can,
successfully, perform multiple tasks simultaneously.


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Slintz.

Without knowing, what you are doing, possibly, hopefully, I am wrong
but...

Wording like:

then un-twiddling and forcing the Saved property to TRUE

causes a nagging concern.

If you set the Saved property to true, the workbook will not save,

because
the Excel accepts believes the Save to have been effected already.

As I said, I may well be wrong but, especially in the light of your
experience, the Save operation and setting Save =True do not
immediately
strike me as likely bedfellows.

Just a thought...

---
Regards,
Norman



"slintz" wrote in message
...
Good idea AND still not working... <grrr

In fact, the Save method is being fired from within
Workbook_BeforeSave(),
which needs to do some preparations for the next open (ie. twiddle
some
stuffs just before saving, saving, then un-twiddling and forcing the
Saved
property to TRUE). My event sub dutifully dis-ables events before the
doing
the problem Save, then re-ables events afterwards.

Still, this is a very good lead that I will look more closely at...
THANX!








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
Why doesn't While ActiveWorkBook < Null work? [email protected] Excel Discussion (Misc queries) 3 May 27th 07 12:05 AM
save as mode doesnt work seachange49 Excel Discussion (Misc queries) 0 April 26th 06 09:26 PM
Can't get ActiveWorkbook.Container to work Ken Valenti Excel Programming 3 March 17th 05 04:05 PM
troubles with ActiveWorkbook.Save Gabriele C[_4_] Excel Programming 1 August 11th 04 05:35 PM
protect module and work in activeworkbook Mark[_17_] Excel Programming 3 September 28th 03 10:43 PM


All times are GMT +1. The time now is 12:16 AM.

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"