msAccess Report Header export to Excel

  • Thread starter Thread starter slickdock
  • Start date Start date
S

slickdock

I have no excel skills, only msAccess. I can successfully automate the
exporting of my access report to excel using a macro's OutputTo command,
output format excel.

The header is the problem. I want my excel header to look like my multi line
access report header. Instead it breaks each object up into 1 line of
continuous cells.

It should look like this:

Left Aligned Date: 6/5/09 My Centered Report Title
Left Aligned Check No.: 154 My Centered Company Name

Thank you.
 
The issue may only be formating. try highlighting row 1 of the spreadsheet.
the go to worksheet menu format - cells - alignment - Wrap Text.
 
That didn't work. Also, maybe I should have been clear to say I don't want
the user to have to do anything in excel; I would like to automate the
process so the worksheet comes over with no more formatting needs.
 
How good are you with VBA programming in ACCESS. the excel portion of the
code isn't too complicated.

You can run this macro from access. Yo can get each row of data from the
access database and write the data to the workbook



Sub OpenExcel()

Set excelobj = CreateObject("Excel.application")
excelobj.Application.Visible = True
With excelobj
Set bk = excelobj.workbooks.Add
With .sheets(1)
'write header row
.Range("A1") = "Number"
For RowCount = 2 To 100
.Range("A" & RowCount) = RowCount

Next RowCount

End With
End With


End Sub
 
Back
Top