Sending and manipulating data from Access 97 to Excel 97 
Author Message
 Sending and manipulating data from Access 97 to Excel 97

Hi,

I have a question for you "Gurus" out there....

I have 2 reports that I want to transfer to an excel workbook. My customer
doesn`t like the layout of the worksheet when using the transfer to excel
button on the toolbar....

So what I want to do is take the records from the recordset 1 created in VBA
(that part is ok) and lace them in a worksheet 1 of the workbook.

Then i want to take the records in the recordset 2 and copy it in the
worksheet 2 of the same workbook.

I also want to type in the headers in each worksheet (they are different in
each worksheet where a cell must have a value of a string type variable that
I want to pass on to Excel)

So basically what i need to do is this (if the above seemed as confuse as I
am):

1-Create a workbook
2-Create 2 worksheets
3- Write information and format text to a couple of cells at top of each
    Worksheet.
4- Transfer a recordset to Excel
5-save the workbook and keep it visible.

I tried doing it through automation but I guess I`m not familiar enough with
that. Any pointers would be greatly appreciated.

Thanks in advance

Daniel Collette



Sun, 30 Nov 2003 07:36:19 GMT  
 Sending and manipulating data from Access 97 to Excel 97

Quote:

> 1-Create a workbook
> 2-Create 2 worksheets
> 3- Write information and format text to a couple of cells at top of each
>     Worksheet.
> 4- Transfer a recordset to Excel
> 5-save the workbook and keep it visible.

Take a look at this link.

[ http://www.mvps.org/access/modules/mdl0035.htm ]

To format the cells at the top, you can either apply the format to the
entire Range (row), or go cell by cell writing data and applying the format.

  Set objWkb = .Workbooks.Add
  Set objSht = objWkb.Worksheets(1)
  With objSht
   for i=1 to rs.fields.count
        .cells(1,i) = "Something " & rs.fields(i-1).name
   next
    .Range(.Cells(2, 1), .Cells(intMaxRow+1, _
        intMaxCol)).CopyFromRecordset rs
  End With

  -- Dev



Sun, 30 Nov 2003 21:36:26 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. sending bookmark data from word 97 to access 97 database

2. Urgent : Exporting Access 97 data to Excel 97

3. Exporting Access 97 data to Excel 97

4. Sending data to excel from access - automation 97.

5. Send data to Excel fail with Excel 97

6. Insert data from Excel 97 into Word 97

7. Sending text to Word 97 from Access 97 using OLE automation

8. vba code to copy table from access 97 to excel 97

9. Automation Problem with Access 97/Excel 97

10. importing excel 97 srpeadsheets to access 97

11. Import from Excel 97 to Access 97 table

12. How to link a password protected Excel 97 Spreadsheet to Access 97

 

 
Powered by phpBB® Forum Software