Microsoft XL Spreadsheet

  • Thread starter Thread starter Snurre
  • Start date Start date
S

Snurre

Hi, I run a query and make an Excel spreadsheet. However,
how do I get rid of the Field names?

DoCmd.OutputTo acOutputQuery, "rwGiro",
acFormatXLS, "c:\file.xls"

Id Lastname Firstname Address PostNumber
824 DERSYD TROND HEGGERISET 2440
853 WILLIAMS RONNY VEIBERG 2034


Regards
Snurre
 
hi,
I don't think you can get rid of the field names. Access
sends it as a table with field names. you might try a
excel macro to delete them but i think that is it.
sorry.
 
Snurre said:
Hi, I run a query and make an Excel spreadsheet. However,
how do I get rid of the Field names?

DoCmd.OutputTo acOutputQuery, "rwGiro",
acFormatXLS, "c:\file.xls"

Id Lastname Firstname Address PostNumber
824 DERSYD TROND HEGGERISET 2440
853 WILLIAMS RONNY VEIBERG 2034

The following does it in two stages:

Export data with headers:

SELECT
Id, Lastname, Firstname, Address, PostNumber
INTO
[Excel 8.0;HDR=NO;Database=C:\File.xls;].Sheet1
FROM MyTable
;

Clear the header row:

UPDATE
[Excel 8.0;HDR=NO;Database=C:\File.xls;].[Sheet1$A1:E1]
SET
F1=null, F2=null, F3=null, F4=null, F5=null
;

Jamie.

--
 
I don't think you can get rid of the field names. Access
sends it as a table with field names.

More correctly, an INSERT INTO is performed under the covers. Jet
requires column headers for an INSERT INTO so the provider creates
them. AFAIK there is no getting round this issue.
you might try a
excel macro to delete them but i think that is it.

You can also use a query, as shown in my post.

Jamie.

--
 
Ok, that works, but how do I delete the row ?

snurre
-----Original Message-----
Snurre said:
Hi, I run a query and make an Excel spreadsheet. However,
how do I get rid of the Field names?

DoCmd.OutputTo acOutputQuery, "rwGiro",
acFormatXLS, "c:\file.xls"

Id Lastname Firstname Address PostNumber
824 DERSYD TROND HEGGERISET 2440
853 WILLIAMS RONNY VEIBERG 2034

The following does it in two stages:

Export data with headers:

SELECT
Id, Lastname, Firstname, Address, PostNumber
INTO
[Excel 8.0;HDR=NO;Database=C:\File.xls;].Sheet1
FROM MyTable
;

Clear the header row:

UPDATE
[Excel 8.0;HDR=NO;Database=C:\File.xls;].[Sheet1 $A1:E1]
SET
F1=null, F2=null, F3=null, F4=null, F5=null
;

Jamie.
 
Back
Top