Output query to excel via code?

S

SirPoonga

Output query to excel via code?

Would this be a job for TransferSpreadsheet or OutputTo? And how would
I do it?
 
M

[MVP] S.Clark

TransferSpreadsheet is fine. Create a new macro, add the action, enter the
parameters, then run the Macro.
 
S

SirPoonga

I decided to use Output To because I output a query and a table to
excel withing two lines of code. Looks nicer in code:)

Now, how do I export the code so the first row isn't highlightes in
gray?
 
K

Ken Snell [MVP]

Use TransferSpreadsheet. It doesn't export as a formatted output, which is
what OutputTo is doing.

Also, OutputTo will truncate the export at 16,384 records, and will truncate
all text strings longer than 255 characters.
 
Top