Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Export Table Macro in QV 10

Hi All,

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 AD=ActiveDocument
Set MN=AD.Fields("Month_Name")
Set XLApp = CreateObject("Excel.Application")
Path = "RightPath"
FileName = "RigthFile.xls"

XLApp.Visible=True
Set XLS = XLApp.Workbooks.Open(Path & FileName)



XLS.Worksheets("JanData").Visible = True

'Jan
MN.Select "Jan"
ActiveDocument.GetSheetObject(6).CopyTableToClipboard True
XLS.Worksheets("JanData").Range("B1").Select
XLS.Worksheets("JanData").Paste()

****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.

Thanks,

Austin

1 Solution

Accepted Solutions
Not applicable

Export Table Macro in QV 10

I needed to add these two lines of code before the .Select line

XLS.Worksheets("JanData").Visible = True

XLS.Worksheets("JanData").Activate



1 Reply
Not applicable

Export Table Macro in QV 10

I needed to add these two lines of code before the .Select line

XLS.Worksheets("JanData").Visible = True

XLS.Worksheets("JanData").Activate



Community Browser