Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default SaveAs needed if new

Wes,

You can use the Path property to determine whether a workbook has ever been
saved. If this property returns an empty string, you are working with a new,
unsaved workbook. E.g.,

If ActiveWorkbook.Path = "" Then
' new, unsaved workbook
Else
' existing workbook
End If

You can use the Saved property to determine whether a workbook is in a saved
state, i.e., no save is required. E.g.,

If ActiveWorkbook.Saved = True Then
' no save required
Else
' save required.
End If

You can use the Application.GetSaveAsFilename to display the Save As dialog.
This method will return the file name chosen by the user. Note the
GetSaveAsFilename does not actually save the file; it merely returns a
filename. E.g.,

Dim FName As Variant
FName = Application.GetSaveAsFilename()
If FName = False Then
' user cancelled
Else
MsgBox "File name: " & FName
End If

Combining the above procedures should give you the functionality you need.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com






"Wes Jester" wrote in message
...
Is there a method to invoke something similar to the "standard" save.
My users can open an exisitng spreadsheet or a new S/S using a template.
As part of the app, I need to determine if the sheet they are working on
has already been saved. If so, I can simply issue a object.Save.

Otherwise, I would like the app to mimic the Save action that happens
when you save a workbook the first time.

Essentially, I want to do exactly what EXCEL does when one tries to do a
Save the first time. I just don't know how to do it in code.

Any help is appreciated.


Wes

*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
Using SaveAs SarahN Excel Discussion (Misc queries) 3 May 14th 10 04:26 AM
SaveAs - VBA Jae[_3_] Excel Discussion (Misc queries) 4 April 10th 08 08:10 PM
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM


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