Help with macros in Qlikview

I.am.Sam

Honorary Master
Joined
Jun 14, 2011
Messages
97,878
Reaction score
17,330
Location
In your mind ...rent free
Hi,

Any QV experts here ?

I have few pivot sheets that i would like to send to excel. One excel file should have the 4 pivots.

I have a code for it but i am not sure what is the meaning of this as someone else wrote the code

When i adjust the code with the new sheets, only one gets sent to excel

Code:
sub exportToExcel_Variant3

Dim aryExport(3,4)


aryExport(0,0) = "CH01"
aryExport(0,1) = "AgentPerDay"
aryExport(0,2) = "A1" 				
aryExport(0,3) = "data"

aryExport(1,0) = "CH02" 	
aryExport(1,1) = "TeamPerDay" 
aryExport(1,2) = "E1"
aryExport(1,3) = "data"

aryExport(2,0) = "CH03" 	
aryExport(2,1) = "DeptPerDay" 
aryExport(2,2) = "A1"
aryExport(2,3) = "data"

aryExport(3,0) = "CH04" 	
aryExport(3,1) = "OpsPerDay" 
aryExport(3,2) = "A1"
aryExport(3,3) = "data"



Dim objExcelWorkbook 'as Excel.Workbook
Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)

what does the
Dim aryExport(3,4) and aryExport(0,0) mean ?
 
Not familiar with QV but have a little knowledge of Excel.

The dim is the size - 3 rows and 4 columns. But by the rest of the code there are actually 4 rows.
The rest is the layout for the pivot structure. (row,column)

CH01 AgentPerDay A1 data
CH02 TeamPerDay E1 data
CH03 ... etc

I could of course be totally off-base here - but that is how it reads to me
 
Not familiar with QV but have a little knowledge of Excel.

The dim is the size - 3 rows and 4 columns. But by the rest of the code there are actually 4 rows.
The rest is the layout for the pivot structure. (row,column)

CH01 AgentPerDay A1 data
CH02 TeamPerDay E1 data
CH03 ... etc

I could of course be totally off-base here - but that is how it reads to me

Yip, the first lines creates the excel object instance, the 'copyObjectsToExcelSheet(ActiveDocument, aryExport)' does exactly like it says, its return type is the information set to the excel sheet, if you change the code, you'll also need to check what is being processed in the function, could be that your change disrupts the hard coded field copies in the function, hence the odd behavior.
 
Top
Sign up to the MyBroadband newsletter
X