export query to excel problem

davidoc

Registered User.
Local time
Today, 17:22
Joined
Nov 14, 2003
Messages
25
folks,
I'm trying to export a query to excel and it is mostly successful. The problem is that certain fields containing multiple words appear in the column and the whole column appears to be right justified, ie only the last 10 characters are displayed depending on column width. I can't change it so that the it is left justified no matter what I've tried. Everything is there but I can only see it if I expand the column manually which is not a reasonable solution.

I am totally confused - I've never seen excel do this before. Can anyone shed some light? Is it something to do with excel or is the problem in access?

cheers for any help
Dave
 
Is there a chance that somewhere above your text in that column, you have some decimal numbers? The wizard might have seen decimal numbers first and decided to stick you with a numeric column decimal-justified. You might have a decimal-aligned column, for which just setting left/center/right justification isn't enough. You have to change column styles to text and THEN left-justify it. I think.
 
Which method are you using? The OutputTo or the TransferSpreadsheet method? Try the other and see if there is a difference. Each has it's advantages and vice versa.
 
this is the method:

DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS, , True

I have never used the transferspreadsheet method. What would be the equivalent line using it?
 
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "YourQueryName", "C:\Test.xls", True

Check the help files for more info and options with the TransferSpreadsheet method.
 

Users who are viewing this thread

Back
Top Bottom