I am trying to write a macro to export data from a table from QV to an excel spreadsheet. I am new to this and so I am having trouble debugging and fixing the error that I am receiving. Here is the macro so far..
Set XLApp = CreateObject("Excel.Application")
Path = "RightPath"
FileName = "RigthFile.xls"
Set XLS = XLApp.Workbooks.Open(Path & FileName)
XLS.Worksheets("JanData").Visible = True
****Then I get this error on the bolded and underlined row:"Select method of Range class failed"
Any suggestions as to why this macro errors out on this row would be great.