LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Workbook.SaveAs


This code did work before.... All I am trying to do is a SaveAs to another
directory.
I am using Office 2003....

I get no errors but the SaveAs function doesn't rename the current workbook
that is open nor does it savea copy to the forlder specified...what gives?

Here is my code:

Sub SaveAsFile()
Dim strDocName As String
Const FilePath As String = "H:\Client\"

On Error GoTo err_handler

ChDrive FilePath
ChDir FilePath
strDocName = Application.GetSaveAsFilename(filefilter:="*.xls, *.xls")
If strDocName < "False" Then
'do not allow it to be stored in the local directory
If (Left(strDocName, 33) = "H:\Client\Deliverables Schedules") Then
MsgBox "This schedule must be saved to the appropriate folder on
H:\Client!", vbCritical, "Wrong Folder"
Cancel = True
Else
ActiveWorkbook.SaveAs strDocName
End If

End If
Exit Sub

err_handler:

MsgBox Err.Number & " " & Err.Description

End Sub

 
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
SaveAs uses current open workbook filename; big wheelz Excel Programming 3 September 2nd 06 11:17 AM
Workbook::SaveAs() in MFC - Please help! ArukTheRed Excel Programming 1 August 15th 05 04:29 PM
worksheet saveas workbook Nigel Excel Programming 2 August 11th 05 05:40 PM
Canceling SaveAs dialog box without saving workbook CDotWin Excel Programming 3 July 24th 04 01:09 AM
Workbook.SaveAs Paul Excel Programming 2 August 25th 03 08:12 PM


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