Link to home
Start Free TrialLog in
Avatar of upobDaPlaya
upobDaPlaya

asked on

How to pass records from MS Access to an MS Excel template

I am familiar with how to establish a MS Excel session within MS Access and manipulate records within MS Excel from MS Access  However, if I need to take a 1000 records from an MS Acccess table (75 columns) and put that information into an MS Excel template file what is the most efficient way of accomplishing this task.  Any links or example would be great.

I assume I would want to loop thru my table and work on a record at a time keeping track of what row I am on within MS Excel...

Note I can not do a docmd since the purpose of the MS Excel template is to avoid any formatting I may need to do once the data is within MS Excel.  However, I am wondering if I am better off doing a docmd and getting the data out into the workbook and then attempting the formatting from within MS Access
SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
is "MS Excel template" really a template (.xlt, .xltx)  or just a preformatted Excel workbook?
Avatar of upobDaPlaya
upobDaPlaya

ASKER

I have attached a sample of what I am trying to do.  I have an MS Access DB that has 2 tables.  Each table will be placed in its own MS Excel worksheet, but the same workbook.  Note the Excel workbook has formatting in addition to formulas I need to display (row 11 Profile worksheet and row 6 Hours worksheet).

The Hours tab is somewhat standard in I assume I will write the data from the MS Access Hours table to the Hours worksheet, although I am struggling with how I would display the formulas.  In addition the Hours tab currently has 6 rows, but the amount of row I will try to write from the MS Access Hours table will not always be 6 rows.

The Profile tab is a little trickier since some cells are only populated once and it is not a 1 to 1 drop from the MS Access table.

Lastly I am creating a workbook for each Profile ID.  I am looping thru to get each Profile ID so that is not an issue.
eeExcel.xlsx
eeMSAccess.accdb
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial