?
Solved

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

Posted on 2014-12-10
4
Medium Priority
?
167 Views
Last Modified: 2014-12-14
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
0
Comment
Question by:upobDaPlaya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 800 total points
ID: 40493197
Hi,

Instead of DoCmd you could Use within Excel CopyRecordSet

http://msdn.microsoft.com/en-us/library/office/ff839240(v=office.15).aspx

Regards
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40493607
is "MS Excel template" really a template (.xlt, .xltx)  or just a preformatted Excel workbook?
0
 

Author Comment

by:upobDaPlaya
ID: 40493949
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
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1200 total points
ID: 40496386
place this in the same folder as your excel file, then run Export2XL in module 1
eeMSAccess.accdb
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question