Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export query to a specified location on Excel

Status
Not open for further replies.

EdwardSalas

Technical User
Oct 20, 2004
8
US
Greetings all,

I have the following code in which I'm utilizing to export my results from a query to a user defined location:

Dim strFilter As String
Dim strInputFileName As String
Dim strpath
Dim strSQL

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave(filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an output file...", _
Flags:=ahtOFN_HIDEREADONLY)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "PAT_UPLOAD", strInputFileName

It works like a charm, but now I'm running into a problem that I did not forsee. The results of the information starts at the A1 cell location on the file which is messing with an upload process that the business has.

Is there a way to possibly have the results (with the header) start on A2 versus the standard A1?

Many thanks!
 
If your using Access you might take a look at CopyFromRecordset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top