Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Excelerate-nl
 
Posts: n/a
Default Display message during save operation

Dear Experts,

I would like to display a message during a save operation of a sheet (it is
quite a large file so it takes a while).
There is another thing related to this: When a user starts this spreadsheet
without enabling the macro's, the workbook is opened with a sheet showing a
text box with the message "Please reopen with macro function on". In the
BeforeSave event macro I activate this sheet with the text box (so it will be
shown on next start up). However this results in the display of the text box
"Please reopen with macro function on" during a save operation (which is
quite confusing).

Please help,

Jan Bart
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Display message during save operation

Jan,

Try this BeforeSave alternative, it should take care of both issues

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
MsgBox "This may take a while"
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If sFile < False Then
ThisWorkbook.SaveAs sFile
Worksheets("Startup").Activate
End If
Else
ThisWorkbook.Save
orksheets("Startup").Activate
End If
Application.EnableEvents = True
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in message
...
Dear Experts,

I would like to display a message during a save operation of a sheet (it

is
quite a large file so it takes a while).
There is another thing related to this: When a user starts this

spreadsheet
without enabling the macro's, the workbook is opened with a sheet showing

a
text box with the message "Please reopen with macro function on". In the
BeforeSave event macro I activate this sheet with the text box (so it will

be
shown on next start up). However this results in the display of the text

box
"Please reopen with macro function on" during a save operation (which is
quite confusing).

Please help,

Jan Bart



  #3   Report Post  
Posted to microsoft.public.excel.misc
Excelerate-nl
 
Posts: n/a
Default Display message during save operation

Dear Bob,

Thanks for your reply!
I do not realy understand this macro.
Probably I didn't explain myself all to well.

I will make it more explicit:
When opening my file it will display sheet1 with a textbox "You opened the
file without enabling the macro function".
When the macro is enabled this textbox is initially Hidden by the macro (you
will only see a short flash of it) and a menu Form is displayed.
Now before I save the file again the BeforeSave event makes the worksheet
hide all other sheets but Sheet1. Also I have to make the textbox visible
again before saving the file, because it should be there when opened with
macro's disabled.
What happens is that it shows during the actual writing of the file to the
hard disk.
Actually I would need something as a "DuringSave" event.....

I hope this makes thing more clear?!

Regards,
Jan Bart

"Bob Phillips" wrote:

Jan,

Try this BeforeSave alternative, it should take care of both issues

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
MsgBox "This may take a while"
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If sFile < False Then
ThisWorkbook.SaveAs sFile
Worksheets("Startup").Activate
End If
Else
ThisWorkbook.Save
orksheets("Startup").Activate
End If
Application.EnableEvents = True
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in message
...
Dear Experts,

I would like to display a message during a save operation of a sheet (it

is
quite a large file so it takes a while).
There is another thing related to this: When a user starts this

spreadsheet
without enabling the macro's, the workbook is opened with a sheet showing

a
text box with the message "Please reopen with macro function on". In the
BeforeSave event macro I activate this sheet with the text box (so it will

be
shown on next start up). However this results in the display of the text

box
"Please reopen with macro function on" during a save operation (which is
quite confusing).

Please help,

Jan Bart




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Display message during save operation

Jan,

I understand what you are doing and what you want.

I think what I gave does that. Have you tried it? If so, in what way does it
not do what you want?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in message
...
Dear Bob,

Thanks for your reply!
I do not realy understand this macro.
Probably I didn't explain myself all to well.

I will make it more explicit:
When opening my file it will display sheet1 with a textbox "You opened the
file without enabling the macro function".
When the macro is enabled this textbox is initially Hidden by the macro

(you
will only see a short flash of it) and a menu Form is displayed.
Now before I save the file again the BeforeSave event makes the worksheet
hide all other sheets but Sheet1. Also I have to make the textbox visible
again before saving the file, because it should be there when opened with
macro's disabled.
What happens is that it shows during the actual writing of the file to the
hard disk.
Actually I would need something as a "DuringSave" event.....

I hope this makes thing more clear?!

Regards,
Jan Bart

"Bob Phillips" wrote:

Jan,

Try this BeforeSave alternative, it should take care of both issues

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
MsgBox "This may take a while"
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls),

*.xls")
If sFile < False Then
ThisWorkbook.SaveAs sFile
Worksheets("Startup").Activate
End If
Else
ThisWorkbook.Save
orksheets("Startup").Activate
End If
Application.EnableEvents = True
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in

message
...
Dear Experts,

I would like to display a message during a save operation of a sheet

(it
is
quite a large file so it takes a while).
There is another thing related to this: When a user starts this

spreadsheet
without enabling the macro's, the workbook is opened with a sheet

showing
a
text box with the message "Please reopen with macro function on". In

the
BeforeSave event macro I activate this sheet with the text box (so it

will
be
shown on next start up). However this results in the display of the

text
box
"Please reopen with macro function on" during a save operation (which

is
quite confusing).

Please help,

Jan Bart






  #5   Report Post  
Posted to microsoft.public.excel.misc
Excelerate-nl
 
Posts: n/a
Default Display message during save operation

Dera Bob,

What it does is that it gives the Msgbox (but not during the actual file
save writing proces, because you have to click on Ok to proceed). Then a file
Open menu is displayed?! (shouldn't it be GetSavaAsFilename??). I do not see
that the how the textbox is prevented from showing up in the Startup sheet???

Regards,

Jan Bart
"Bob Phillips" wrote:

Jan,

I understand what you are doing and what you want.

I think what I gave does that. Have you tried it? If so, in what way does it
not do what you want?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in message
...
Dear Bob,

Thanks for your reply!
I do not realy understand this macro.
Probably I didn't explain myself all to well.

I will make it more explicit:
When opening my file it will display sheet1 with a textbox "You opened the
file without enabling the macro function".
When the macro is enabled this textbox is initially Hidden by the macro

(you
will only see a short flash of it) and a menu Form is displayed.
Now before I save the file again the BeforeSave event makes the worksheet
hide all other sheets but Sheet1. Also I have to make the textbox visible
again before saving the file, because it should be there when opened with
macro's disabled.
What happens is that it shows during the actual writing of the file to the
hard disk.
Actually I would need something as a "DuringSave" event.....

I hope this makes thing more clear?!

Regards,
Jan Bart

"Bob Phillips" wrote:

Jan,

Try this BeforeSave alternative, it should take care of both issues

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
MsgBox "This may take a while"
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls),

*.xls")
If sFile < False Then
ThisWorkbook.SaveAs sFile
Worksheets("Startup").Activate
End If
Else
ThisWorkbook.Save
orksheets("Startup").Activate
End If
Application.EnableEvents = True
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Excelerate-nl" wrote in

message
...
Dear Experts,

I would like to display a message during a save operation of a sheet

(it
is
quite a large file so it takes a while).
There is another thing related to this: When a user starts this
spreadsheet
without enabling the macro's, the workbook is opened with a sheet

showing
a
text box with the message "Please reopen with macro function on". In

the
BeforeSave event macro I activate this sheet with the text box (so it

will
be
shown on next start up). However this results in the display of the

text
box
"Please reopen with macro function on" during a save operation (which

is
quite confusing).

Please help,

Jan Bart








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
Display a message when a file is opened. Sheila New Users to Excel 4 November 15th 05 05:14 PM
How to save a file without overwrite or save a copy? SettingChange Setting up and Configuration of Excel 1 November 3rd 05 02:10 AM
Getting message can't save all data in excel xls file Melody05 Excel Discussion (Misc queries) 2 June 29th 05 12:20 PM
Display message based on condition Pat Excel Worksheet Functions 1 March 7th 05 10:52 PM
Combine & Display “Fixed” & “Automatically Updated” Date Parts texcel Excel Worksheet Functions 1 November 1st 04 05:38 PM


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