View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_438_] joel[_438_] is offline
external usenet poster
 
Posts: 1
Default Saving a Workbook cause's Error's


I don't like combining instructions together like the one below

bk.SaveAs Filename:=Application.GetSaveAsFilename(strFile)

If make debugging harder and makes it harder to understand. In this
case it didn't give you the results you wanted. I split this
instruction up into pieces below and also added "*.xls" to the strFile
so you can see all the files.


' Save Eng Spec 11 Control Button
Private Sub Save_Eng_Spec_11_Click()

Dim strFile As String
Dim bk As Workbook

Set bk = ActiveWorkbook

strFile = "SPEC " & TEO_No_1.Value _
& Space(1) & CLLI_Code_1.Value _
& Space(1) & CES_No_1.Value _
& Space(1) & TEO_Appx_No_2.Value _
& "*.xls"

FName = Application.GetSaveAsFilename(strFile)

If FileToSave < False Then
MsgBox "The Save Method Failed, Eng Spec was not Saved", , "C.E.S."
Exit Sub
End If

bk.SaveAs Filename:=FName

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=165872

Microsoft Office Help