Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exporting to Excel Question (2003)

    Hi,
    I have 2 general questions. In the Excel spreadsheet I have the cells set to wrap text. When I export data from a database to the sheet the cells won't wrap, why is that? Do I need to put something in the code?

    Question 2: I want to export data several times a month to the same sheet. But I'm not sure how to tell the code to add the data from the db onto the bottom of the data on the spreadsheet, meaning, find the next empty row and add the new data there. Or if I can't do that, can I tell it to start at a particular row, insert rows and then add the new data there?

    Thanks,
    Deb

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting to Excel Question (2003)

    Deb,

    Access replaces the worksheet each time it exports. That is why the formats don't stay.

    What I do is run a macro that checks if there is data in the exported sheet and if there is I find the next available line in another worksheet and append the new rows into that sheet.

    I then clear the access imported sheet so if it is opened a second time I don't get duplicate data moved to my capture sheet.

    I'm not aware of any parameter that will just append to the current sheet.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

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

    Re: Exporting to Excel Question (2003)

    Another possibility is to handle things from the Excel side. You can use the CopyFromRecordset method of the Range object, the online help for Excel VBA has an example.

Posting Permissions

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