Please see the code I'm using now.
Public Function sheetlayout()
On Error GoTo Err_Command1_Click
Dim xl As Object
Set xl = GetObject("c:\windows\desktop\123.csv")
xl.Application.Visible = True
xl.Parent.windows(1).Visible = True
xl.sheets("excellist").Select
xl.sheets("excellist").Rows("1:1").Select
xl.Application.selection.Delete = True
xl.Application.Save
xl.Application.Quit
Set xl = Nothing
Exit Function
Err_Command1_Click:
MsgBox Err.Description
Resume Next
Exit Function
End Function
However, after "xl.Application.selection.Delete = True" I'm getting a
message "Unable to set the delete property of the range class"
After "Resume Next" a new file is created on the Desktop with the name
Resume.
What am I doing wrong?
Please help!!
Thanks
=======================
M.***********@uva.nl (Marc) wrote in message news:<ae**************************@posting.google. com>...
my*****@hotmail.com (Jacky11) wrote in message news:<46**************************@posting.google. com>...Subject: Hiding field names.
I'm exporting a query with a lot of strings to Excel.
When exporting - is there any way to have the field name hidden or
removed from the query by default?
I don't need the field name as a heading on the excel sheet.
=============
Jacky,
4. You could create a menu-item or commandbutton on a form to start a
macro and/or VBA-procedure like in my example.
success, Marc
example based on one of my own applications:
I had a query to export to a spreadsheet and to do a little layouting
from access.
To hide the column-names you could add:
xl.application.selection.hidden = true