Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    2

    Unanswered: Name the Excel WokBook at the time of creation

    Hi,
    I would like to Name the Excel WorkBook that i create so that by the time i say "Save File"..the file name appears in the File Name Text Box.

    Dim ExObj As Excel.Application
    Dim WbObj As Excel.Workbook
    Dim WsObj As Excel.Worksheet

    Private Sub Command1_Click()
    Set ExObj = CreateObject("Excel.Application")
    Set WbObj = ExObj.Workbooks.Add
    Set WsObj = WbObj.Worksheets.Add
    ....

  2. #2
    Join Date
    Feb 2004
    Posts
    13

    Little Late But....

    If you haven't already worked this out, try using the following as the next line in your code -

    ExObj.ActiveWorkbook.SaveAs Filename:="myFile.xls"

  3. #3
    Join Date
    Mar 2004
    Location
    India
    Posts
    2

    Re: Little Late But....

    Thanks for the reply. I have used the following statement based on the return code i get from a confirmation box.

    xlApp.Dialogs(xlDialogSaveAs).Show("MyFile.xls")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •