msoFileDialogSaveAs problem

M

Macka

I can't get the Execut method to work.
I have this code:

Sub SaveAsDialog()
'Other workbook then this should be active
Dim fd As FileDialog
On Error GoTo OnError
Set fd = Application.FileDialog(msoFileDialogSaveAs)
With fd
.AllowMultiSelect = False
.InitialFileName = ActiveWorkbook.Name
If .Show = -1 Then
.Execute
End If
End With
Exit Sub
OnError:
Debug.Print "Errnumber: " & Err.Number & " " & "ErrDesc: " &
Err.Description
End Sub
'I get this:
'Errnumber: -2147467259 ErrDesc: Method 'Execute' of object 'FileDialog'
failed

Eaven if I just save as C:\MyFile.xls the error ocurres,
so the problem is not write protection or similar error.

Please Help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top