Hi,
The below code will allow the user to open the Save As dialog box,
Now my question is : after the user specify the file name and the path, how can I modify the below code in order to save the file in Excel format when the user click on the Save button
What I need is to use the file name which was specified by the user in the dialog box , and then create an Excel file using the same name & path and the new excel file should not contain any data just empty worksheet
The below code will allow the user to open the Save As dialog box,
Now my question is : after the user specify the file name and the path, how can I modify the below code in order to save the file in Excel format when the user click on the Save button
What I need is to use the file name which was specified by the user in the dialog box , and then create an Excel file using the same name & path and the new excel file should not contain any data just empty worksheet
Code:
Private Sub Command16_Click()
Dim fd As FileDialog
Dim vrtSelectedItem As Variant
Set fd = Application.FileDialog(msoFileDialogSaveAs)
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
MsgBox "The path is: " & vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
Comment