View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Application.Dialogs(xlDialogSaveAs) = res ???

Hi Corey,

Try replacing:

Application.Dialogs(xlDialogSaveAs) = res


with

ActiveWorkbook.SaveAs Filename:=res & ".xls"


---
Regards,
Norman

"Corey" wrote in message
...
res = InputBox("Enter a file name ? ", "Company Name here..")
If res = "" Then Exit Sub
ThisWorkbook.Save
With ActiveWorkbook
Worksheets(Array("A", "1")).Copy
Application.Dialogs(xlDialogSaveAs) = res <========= Error here
End With
End Sub


I get an error in the above.
How do i set res to be the new file name ?

Corey....