A
AlanD
I am writing a macro to archive an individual sheet in a workbook. It copy's
the active.sheet to a "new workbook", and then saves this new workbook by a
name to be entered by the user. I am trying to use FileDialogSaveAs for this
purpose but i'm having a problem, after the user enters a name into the
filename field in the dialog box and clicks save, Excel crashes and gives me
the "Excel has encountered a problem and needs to close"............
HELP!!!
Below is the code around where it crashes, its safe to assume that the
active.sheet has already been copied and the new workbook created,
-----------------------------------------------
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogSaveAs)
With fd
.InitialFileName = "C:\Documents and Settings\Alan\My
Documents\Wahsatch\residents\BJones-Platte.xls"
.Title = "SaveAs 1st-INITIAL, LASTNAME, - ,HOUSENAME"
L1: If .Show = -1 Then
.Execute
Else
MsgBox "Cannot Cancel"
GoTo L1
End If
the active.sheet to a "new workbook", and then saves this new workbook by a
name to be entered by the user. I am trying to use FileDialogSaveAs for this
purpose but i'm having a problem, after the user enters a name into the
filename field in the dialog box and clicks save, Excel crashes and gives me
the "Excel has encountered a problem and needs to close"............
HELP!!!
Below is the code around where it crashes, its safe to assume that the
active.sheet has already been copied and the new workbook created,
-----------------------------------------------
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogSaveAs)
With fd
.InitialFileName = "C:\Documents and Settings\Alan\My
Documents\Wahsatch\residents\BJones-Platte.xls"
.Title = "SaveAs 1st-INITIAL, LASTNAME, - ,HOUSENAME"
L1: If .Show = -1 Then
.Execute
Else
MsgBox "Cannot Cancel"
GoTo L1
End If