Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Merging Spreadsheet via VBA (2003)

    I some code where I transfer info from Access to an Excel Spreadsheet
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, stDocName, strFileNameL (stDocName is the query to be exported, and strFileName is the name of the spreadsheet)

    I now want to transfer this same information to an existing spreadsheet, that has other sheets in it and I don't want to delete the file, but just insert it into the file.

    Is there a way to accomplish this?

    thanks in advance for your consideration.

    Ken

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Merging Spreadsheet via VBA (2003)

    TransferSpreadsheet works as follows:

    - If the target workbook doesn't exist yet, the code will create it with a single worksheet named after the table/query.
    - If the target workbook is already in existence, but there is no worksheet yet with the name of the table/query, the code will create a new worksheet with that name.
    - If the target workbook exists and if it contains a worksheet with the name of the table/query, this worksheet will be overwritten.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Merging Spreadsheet via VBA (2003)

    Hans,

    You know I THOUGHT that was how it was supposed work, but when it appeared that it was not, I paniced. However, after my panic attach and reaching out for help here I discovered a siginficant line of code that resulted in the impression that it was not doing what it was supposed to do. (Kill (strFileNameL).

    In fact, it was doing what I asked, not what I wanted.

    Thanks!

    Ken

Posting Permissions

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