I am using the TransferSpreadsheet method to export a query to a new excel workbook/worksheet. My users need the tab of the new worksheet to be called "Sheet1" due to some vlookups they have in another workbook. I have tried to use the "Range" property but it doesn't seem to work. It is naming the tab the same as my query. Is there a way to give it an alias of "Sheet1" somewhere in my VBA code?
I don't want them to have to open the spreadsheet and rename it each time if possible.
Private Sub cmdSP11_Click()
On Error GoTo Err_cmdSP11_Click
Dim stDocName As String
stDocName = "qSource_Data_SP11" --alias this to "Sheet1" ??
'DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, stDocName, filepath\\SP11\SP11___Download.xls"
Exit_cmdSP11_Click:
Exit Sub
Err_cmdSP11_Click:
MsgBox Err.Description
Resume Exit_cmdSP11_Click
End Sub