scrambled columns on export

G

Guest

This is a bit weird.

I am exporting a report to Excel using the following code:

DoCmd.OutputTo acOutputReport, strReportName, _
acFormatXLS, strWorkbookName, True

This worked fine until I added a couple of unbound text boxes to the report
header. Now, the columns in the worksheet are not in the same sequence as
those in the report; rather, source columns {1st, 2nd, 3rd, 4th, 5th, 6th,
7th, 8th} now map to worksheet columns {A, B, H, I, J, C, D, E, F, G}.

How can I get the columns to export in the original sequence?

Thanks!
 
S

strive4peace

Hi Allen,

check the Top and Left properties of each control -- that is what
determines the order


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Guest

Hi Crystal,

I made sure all the positions and heights were consistent, and that the
bound controls were left-aligned with their respective column headings. The
report looks fine, but the exported worksheet still has scrambled columns.

Also, the column headings are not rearranged in the same way as the data, so
it's a real pain to fix the spreadsheets manually.
 
G

Guest

What a dummy. The output was _not_ being scrambled: I was replacing the
column headers in the spreadsheet using an ActiveX routine, and I got them
wrong.

Thanks anyway!
 
S

strive4peace

Hi Allen,

glad you found the problem! thanks for sharing ;)


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top