Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default save conunderum

how can i put

cancel = true

in the

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)

section of the source code

when ever i do, it won't save the changes. I searched in
the old records and found a reference to
www.cpearson.com/excel/vbe.htm
but this is either too complicated for a 'newbie' like me
or it won't work. If any one can help, please do. I'm
tearing what little hair i do have, out.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default save conunderum

Hi
what are you trying to achieve?
Some workarounds:
After inserting this line in your code type the following
in the Immediate window:
application.enebleevents=false
now save the workbook

after this enter the following in the immediate window
application.enebleevents=True

-----Original Message-----
how can i put

cancel = true

in the

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)

section of the source code

when ever i do, it won't save the changes. I searched in
the old records and found a reference to
www.cpearson.com/excel/vbe.htm
but this is either too complicated for a 'newbie' like me
or it won't work. If any one can help, please do. I'm
tearing what little hair i do have, out.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default save conunderum

Spelling error, change to:
application.enableevents=false

This is language specific to Weevils and won't work in the English version:
application.enebleevents=false
Toby Erkson
Oregon, USA

On Thu, 22 Apr 2004 08:49:55 -0700, "Frank Kabel" wrote:

Hi
what are you trying to achieve?
Some workarounds:
After inserting this line in your code type the following
in the Immediate window:
application.enebleevents=false
now save the workbook

after this enter the following in the immediate window
application.enebleevents=True

-----Original Message-----
how can i put

cancel = true

in the

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)

section of the source code

when ever i do, it won't save the changes. I searched in
the old records and found a reference to
www.cpearson.com/excel/vbe.htm
but this is either too complicated for a 'newbie' like me
or it won't work. If any one can help, please do. I'm
tearing what little hair i do have, out.
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default save conunderum

Hi,

ted daniels wrote:
how can i put

cancel = true

in the

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)

section of the source code

when ever i do, it won't save the changes. I searched in
the old records and found a reference to
www.cpearson.com/excel/vbe.htm
but this is either too complicated for a 'newbie' like me
or it won't work. If any one can help, please do. I'm
tearing what little hair i do have, out.


for example:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
If SaveAsUI Then
MsgBox "User want to 'Save as' the File"
' only 'Save as' will be canceled
Cancel = True
Else
MsgBox "User want to 'save' the file"
' only 'Save' will be canceled
Cancel = True
End If

'Save' and 'Save as' will be canceled
Cancel = True
End Sub


--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

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, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
Save As and save current numbers not the actual formulas and links Frank Menard Excel Discussion (Misc queries) 2 November 9th 06 09:18 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM


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