Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Corey, The SaveAs Dialog offered by Excel requires you manually enter the new file name. It can't be assigned by a variable. Other options would include the API SaveAs Dialog which does allow assignments through variables or by using the FSO (File System Object) script. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=556329 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.Dialogs(xlDialogWorkbookCopy) | Excel Programming | |||
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) | Excel Programming | |||
How to disable the Application Dialogs | Excel Programming | |||
Application.Dialogs(xlDialogFormulaFind).....HELP!!!!!! | Excel Programming | |||
application.dialogs(xlDialogSaveAs) AND CHDIR | Excel Programming |