PDA

View Full Version : Solved: Save only if path is true



jproffer
08-30-2008, 08:58 AM
Basically, I want a code to save, print (as fast draft), and close a file...but if the file is new (no path to which to save) then do not print, do not close, and open the saveas window. I just cant figure out the code for the save part. I've tried:

If Application.Path <> "" Then
Application.Save
Goto 1
Else
If Msgbox("your worksheet has not been printed or saved.",vbOKOnly) = vbOK Then
Application.Dialogs(xlDialogSaveAs).Show
Exit Sub
1
'print and close code is below this and would be skipped if path is nothing


Any help is greatly appreciated.

Also, what is the command for printing as a fast draft? .PrintQuality=(what #)

Bob Phillips
08-30-2008, 11:17 AM
If ActiveWorkbook.Path <> "" Then
ActiveWorkbook.Save
Else
If MsgBox("your worksheet has not been printed or saved.", vbOKOnly) = vbOK Then
Application.Dialogs(xlDialogSaveAs).Show
Exit Sub
End If
End If

jproffer
08-30-2008, 01:22 PM
AHHHHHHH...

ActiveWorkbook.Path



So what is

Application.Path

good for?


That's more for my curiousity than anything else...at any rate, thank you again...you're a scholar and a gentleman.

Bob Phillips
08-30-2008, 02:22 PM
That is the path of the application, Excel.

jproffer
08-31-2008, 01:53 AM
LOL

Ya know, it's makes perfect sense. It was a long, long day.

Application.Path is the Path.....to the Application...**smacks head**

Thanks again xld.