+ Reply to Thread
Results 1 to 3 of 3

importing data from Access

  1. #1
    perky2go
    Guest

    importing data from Access

    I have two mdb's set with macros to import text files, massage the data, and
    then export the resulting tables to several worksheets inside two existing
    Excel files--e.g., the data from Access table "Medicaid Data" gets exported
    to worksheet "Medicaid_Data" on Radiology.xls using TransferSpreadsheet. I
    have another worksheet in the Excel file ("Data") that is filled with
    index/match formulas which point to "Medicaid_Data" so that "Data" serves as
    the graph datasource and updating "Medicaid_Data" succeeds in updating my
    graph without my having to rewrite the formulas each month and also keeps the
    source data with the final report for reference. This worked great last
    month and in testing....

    But now, while one of the Access macros is still behaving as I expected, the
    other one is now creating new worksheets (e.g., "Medicaid_Data1") rather than
    replacing the data on "Medicaid_Data".

    Why am I now getting worksheets added with new names (xxx1) rather than
    updating the existing worksheet with new data? (And why does it work in one
    Access/Excel combo but not the other??)

    With TransferSpreadsheet I have specified:
    Transfer Type: Export
    Spreadsheet Type: MS Excel 97

    In both cases, I am exporting the contents of Access tables created via Make
    Table queries.

    Thanks for any insight!


  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    A look at the code would be useful to get an answer. Need the bit where you open the spreadsheet and send the data.
    Also do you have the spreadsheet used as a linbked table source in the Access database?

    regards

  3. #3
    perky2go
    Guest

    Re: importing data from Access

    Eventually I may get around to writing some VBA to do the work, but what I
    have now is a macro. I haven't done much in VBA and what I did do was a long
    time ago, so sitting down and writing code (even for something relatively
    straightforward) will take a block of time I can't come up with at the moment.

    The macro imports data from a text file, runs queries, then runs
    TransferSpreadsheet four times in succession, transferring the contents of
    four tables in Access to the same Excel spreadsheet, creating four worksheets
    with the names of the tables.

    Transfer Type: Export
    Spreadsheet Type: Microsoft Excel 97 (altho when I print the macro from
    Documentor is says on the printed page "Lotus 1-2-3 (WK1)" for some reason)
    Table Name: MK Rad Costs
    File Name: Y:\...\...\...\Radiology\Radiology.xls
    Has Field Names: Yes
    Range: (left blank)

    Same set up for the one that still works and the one that doesn't.

    In both cases I am exporting to an existing Excel spreadsheet and the
    spreadsheet will already contain worksheets with the same name (generated in
    the previous quarter). My goal is to refresh/replace the data worksheets
    each quarter with worksheets with the same name so that my formulas and graph
    sources, etc. don't have to be revised each time the report is run.



    "tony h" wrote:

    >
    > A look at the code would be useful to get an answer. Need the bit where
    > you open the spreadsheet and send the data.
    > Also do you have the spreadsheet used as a linbked table source in the
    > Access database?
    >
    > regards
    >
    >
    > --
    > tony h
    > ------------------------------------------------------------------------
    > tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
    > View this thread: http://www.excelforum.com/showthread...hreadid=520829
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1