Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Application.Dialogs(xlDialogSaveAs) = res ???

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   Report Post  
Posted to microsoft.public.excel.programming
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....







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Dialogs(xlDialogSaveAs) = res ???


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Dialogs(xlDialogWorkbookCopy) Andy Excel Programming 3 January 18th 06 04:55 AM
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
How to disable the Application Dialogs Philip Excel Programming 1 November 5th 04 08:50 PM
Application.Dialogs(xlDialogFormulaFind).....HELP!!!!!! jason Excel Programming 2 October 1st 04 12:47 PM
application.dialogs(xlDialogSaveAs) AND CHDIR Jules[_2_] Excel Programming 1 September 3rd 03 08:27 PM


All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"