Results 1 to 2 of 2

Thread: List box

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    1

    List box

    Help!!!
    I am trying to access excel files from a list box. The following code has been tested and I am encountering an error on the last line of code.

    Private Sub cmdOpenExcel_click()
    Dim xlApp As Object
    Set xlApp = CreateObject("excel.application")
    xlApp.Visible = True

    xlApp.Open = lstExport.Text 'NAME OF THE LIST BOX'

    This process should allow a user to click a command button and copy whatever files are documented within a list box.

    For example
    1.xls
    2.xls
    3.xls

    The listbox(lstExport) will contain the file names listed above. The user will click on a command button and the process should open excel, open 1.xls, and copy the first six sheets from 1.xls into the first six sheets of a file called testload.xls. A macro within the testload.xls file will upload this info into a another system. Then the second file called 2.xls will open and the first 6 six sheets of that file will be copied into the first 6 sheets of testload.xls (copy paste method or ?????), overwritting the contents from the first file, and so on.

    Help!!!!!!!!

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    dim x
    x = app.path & "\" & lstExport.text

    xlApp.Open x

    or whatever path...no =
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width