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: 258
Default What am I missing here

The code below is suppose to check that cell C2 on the Projections Worksheet
is blank, Then runs the Calendar routine which places the selected date into
cell C2 of the Projections Worksheet. This all works fine but the routine
fails when it gets to the "ActiveWorkbook.SaveAs sFileName" line. I get
an error msg saying "The File name or path does not exist"

Any ideas?


Private Sub CommandButton1_Click()
Sheets("Projections").Select
Range("C2").Select

If ActiveCell 0 Then GoTo Done

Calander.Show

Dim sFileName As String, sTest As String

sTest = Sheets("Projections").Range("C2").Text

If IsDate(sTest) = False Then

Exit Sub

End If

sFileName = "O:\PT_DRIVER_SCHED\Weekly Projections\" & _
Format(sTest, "yyyy\\MM-dd-yy") & " Projection" & ".xls"

ActiveWorkbook.SaveAs sFileName

Done:
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
add-ins missing Newbie Excel Worksheet Functions 1 March 7th 06 08:29 PM
Toolbars Missing, And option to Add Missing SmeetaG Excel Discussion (Misc queries) 3 October 19th 05 11:43 AM
On Error? Creates 1 missing worksheet then never detects any other missing worksheets Craigm[_35_] Excel Programming 2 August 1st 05 02:39 PM
Missing Row Debbie Humphrey Excel Worksheet Functions 3 January 12th 05 06:26 PM
Add-ins missing lrochman Excel Programming 1 October 2nd 03 10:06 PM


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