Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Workbooks_beforeclose() function and out of disk space

Hi,

I have disabled the SAVE AS on my sheet, so users will not be able to
save documents on their personal folder.

I am having trouble dealing with closing the workbook and saving.

I am using the workbooks_beforeclose function and ActiveWorkbook.close
Save=true or something like that (cant remember th ecorrect syntax).

It works fine, but only if there is enough disk space.
We have limited disk space.

I tried to catch the error with ON ERROR GOTO Errohandler:
and at ERRORHANDLER: I do a check if the error is 1004 and display a
message to warn users about it and then exit sub.
The problem is that excel does not stop the closing process and it
then asks if the user wants to save/discard or cancel the changes...

Thats because after exit sub in the errorhandler, excell restarts the
function again???

How can I avoid this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Workbooks_beforeclose() function and out of disk space

The Workbook_BeforeClose function has a Cancel argument. If your error
handler sets this argument to True, the close operation should stop, leaving
the workbook open.

Hope this helps,

Hutch

" wrote:

Hi,

I have disabled the SAVE AS on my sheet, so users will not be able to
save documents on their personal folder.

I am having trouble dealing with closing the workbook and saving.

I am using the workbooks_beforeclose function and ActiveWorkbook.close
Save=true or something like that (cant remember th ecorrect syntax).

It works fine, but only if there is enough disk space.
We have limited disk space.

I tried to catch the error with ON ERROR GOTO Errohandler:
and at ERRORHANDLER: I do a check if the error is 1004 and display a
message to warn users about it and then exit sub.
The problem is that excel does not stop the closing process and it
then asks if the user wants to save/discard or cancel the changes...

Thats because after exit sub in the errorhandler, excell restarts the
function again???

How can I avoid this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Workbooks_beforeclose() function and out of disk space

Hammer

I have disabled the SAVE AS on my sheet, so users will not be able to
save documents on their personal folder.


What means have employed to prevent users from copying the sheets to a new
workbook and saving that?


Gord Dibben MS Excel MVP

On Fri, 28 Mar 2008 13:25:01 -0700, Tom Hutchins
wrote:

The Workbook_BeforeClose function has a Cancel argument. If your error
handler sets this argument to True, the close operation should stop, leaving
the workbook open.

Hope this helps,

Hutch

" wrote:

Hi,

I have disabled the SAVE AS on my sheet, so users will not be able to
save documents on their personal folder.

I am having trouble dealing with closing the workbook and saving.

I am using the workbooks_beforeclose function and ActiveWorkbook.close
Save=true or something like that (cant remember th ecorrect syntax).

It works fine, but only if there is enough disk space.
We have limited disk space.

I tried to catch the error with ON ERROR GOTO Errohandler:
and at ERRORHANDLER: I do a check if the error is 1004 and display a
message to warn users about it and then exit sub.
The problem is that excel does not stop the closing process and it
then asks if the user wants to save/discard or cancel the changes...

Thats because after exit sub in the errorhandler, excell restarts the
function again???

How can I avoid this?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Workbooks_beforeclose() function and out of disk space

Hi,

Good question.
The sheets are locked and macros are necessary to function properly,
if someone would copy the worksheet to a different workbook it would
be useless.
But your question raises another one more important, what if the user
in explorer copies the file to a different name and uses it?
I guess I will need to check the filename afterall. hmmm

On Mar 28, 5:36*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Hammer

I have disabled the SAVE AS *on my sheet, so users will not be able to
save documents on their personal folder.


What means have employed to prevent users from copying the sheets to a new
workbook and saving that?

Gord Dibben *MS Excel MVP

On Fri, 28 Mar 2008 13:25:01 -0700, Tom Hutchins



wrote:
The Workbook_BeforeClose function has a Cancel argument. If your error
handler sets this argument to True, the close operation should stop, leaving
the workbook open.


Hope this helps,


Hutch


" wrote:


Hi,


I have disabled the SAVE AS *on my sheet, so users will not be able to
save documents on their personal folder.


I am having trouble dealing with closing the workbook and saving.


I am using the workbooks_beforeclose function and ActiveWorkbook.close
Save=true or something like that (cant remember th ecorrect syntax).


It works fine, but only if there is enough disk space.
We have limited disk space.


I tried to catch the error with ON ERROR GOTO Errohandler:
and at ERRORHANDLER: I do a check if the error is 1004 and display a
message to warn users about it and then exit sub.
The problem is that excel does not stop the closing process and it
then asks if the user wants to save/discard or cancel the changes...


Thats because after exit sub in the errorhandler, excell restarts the
function again???


How can I avoid this?


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
Save a file to disk without re-formating the disk Frustrated Mike Excel Discussion (Misc queries) 2 February 19th 09 07:33 PM
Getting Amount Free Disk Space On A Drive mrclinker Excel Discussion (Misc queries) 2 May 12th 06 01:16 PM
Free disk space chart in Excel Edi Charts and Charting in Excel 0 August 30th 05 08:46 PM
Any Tricks to decreasing Workbook size (disk space usage)? Bruce Excel Discussion (Misc queries) 3 August 16th 05 02:20 PM
Download files from 3.5 disk in excel but system said disk need fo DG Excel Discussion (Misc queries) 0 August 13th 05 04:16 PM


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