Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Use of SaveAsUI

Excel 2003, WinXP
I need some educating. How do you use the SaveAsUI variable in the macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Thanks for your help. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Use of SaveAsUI

It's used to check to see if the user is seeing that File|SaveAs dialog.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "user is seeing the SaveAs dialog"
Else
MsgBox "user is not seeing that box"
End If
End Sub

Not seeing the dialog could mean that the user hit the save, a macro ran save
(or saveAs).

(UI = UserInterface = manually)


Otto Moehrbach wrote:

Excel 2003, WinXP
I need some educating. How do you use the SaveAsUI variable in the macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Thanks for your help. Otto


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Use of SaveAsUI

Dave
Please look at this macro. The intent is to Cancel the Save command,
make some checks, then save the file if the checks are good.
As written, the message box gives me a True if I hit SaveAs and a False
if I hit Save. And that's what you said it would do. But in neither case
does the SaveAs dialog box appear. Am I missing something? Thanks for your
help. Otto
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox SaveAsUI
Cancel = True
Call ChkCells
If CancelA = False Then
Application.EnableEvents = False
ThisWorkbook.Save
ThisWorkbook.Saved = True
Application.EnableEvents = True
End If
End Sub
"Dave Peterson" wrote in message
...
It's used to check to see if the user is seeing that File|SaveAs dialog.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = True Then
MsgBox "user is seeing the SaveAs dialog"
Else
MsgBox "user is not seeing that box"
End If
End Sub

Not seeing the dialog could mean that the user hit the save, a macro ran
save
(or saveAs).

(UI = UserInterface = manually)


Otto Moehrbach wrote:

Excel 2003, WinXP
I need some educating. How do you use the SaveAsUI variable in the
macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Thanks for your help. Otto


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Use of SaveAsUI

Cancel = true
stops the SaveAs--so you never see the dialog, but your code does its own save
(under certain conditions).




Otto Moehrbach wrote:

Dave
Please look at this macro. The intent is to Cancel the Save command,
make some checks, then save the file if the checks are good.
As written, the message box gives me a True if I hit SaveAs and a False
if I hit Save. And that's what you said it would do. But in neither case
does the SaveAs dialog box appear. Am I missing something? Thanks for your
help. Otto
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox SaveAsUI
Cancel = True
Call ChkCells
If CancelA = False Then
Application.EnableEvents = False
ThisWorkbook.Save
ThisWorkbook.Saved = True
Application.EnableEvents = True
End If
End Sub
"Dave Peterson" wrote in message
...
It's used to check to see if the user is seeing that File|SaveAs dialog.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = True Then
MsgBox "user is seeing the SaveAs dialog"
Else
MsgBox "user is not seeing that box"
End If
End Sub

Not seeing the dialog could mean that the user hit the save, a macro ran
save
(or saveAs).

(UI = UserInterface = manually)


Otto Moehrbach wrote:

Excel 2003, WinXP
I need some educating. How do you use the SaveAsUI variable in the
macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Thanks for your help. Otto


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Use of SaveAsUI

Thanks Dave. I have it straight now. Otto
"Dave Peterson" wrote in message
...
Cancel = true
stops the SaveAs--so you never see the dialog, but your code does its own
save
(under certain conditions).




Otto Moehrbach wrote:

Dave
Please look at this macro. The intent is to Cancel the Save command,
make some checks, then save the file if the checks are good.
As written, the message box gives me a True if I hit SaveAs and a
False
if I hit Save. And that's what you said it would do. But in neither
case
does the SaveAs dialog box appear. Am I missing something? Thanks for
your
help. Otto
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox SaveAsUI
Cancel = True
Call ChkCells
If CancelA = False Then
Application.EnableEvents = False
ThisWorkbook.Save
ThisWorkbook.Saved = True
Application.EnableEvents = True
End If
End Sub
"Dave Peterson" wrote in message
...
It's used to check to see if the user is seeing that File|SaveAs
dialog.

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = True Then
MsgBox "user is seeing the SaveAs dialog"
Else
MsgBox "user is not seeing that box"
End If
End Sub

Not seeing the dialog could mean that the user hit the save, a macro
ran
save
(or saveAs).

(UI = UserInterface = manually)


Otto Moehrbach wrote:

Excel 2003, WinXP
I need some educating. How do you use the SaveAsUI variable in the
macro:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Thanks for your help. Otto

--

Dave Peterson


--

Dave Peterson



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
SaveAsUI Gun_Maddie Excel Programming 6 January 30th 04 11:03 PM


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