Discussion Board for collaboration related to QlikView App Development.
Dear qlik community,
I have a simple thing (?) that I would like to get support with. I want to export a chart to excel for each customer number that I have in my report. So each customer gets an own excel file. For this reason I have created the below macro (VBScript) - but it only gives me 100 excel files and I have more than 1500 customers.
Could anyone please let me know what I'm doing wrong?
Sub CreateExcelfile
nCount=1
strLibrary="C:\Users\yyyy\Documents\PartsOpportunityFiles\"
ActiveDocument.Variables("vDate").SetContent strDate, true
ActiveDocument.Fields("Final Customer Name and Number").Clear
Set strSupplierList = ActiveDocument.Fields("Final Customer Name and Number").GetPossibleValues
For nCurrentSupplier = 0 To strSupplierList.Count-1
strCurrentSupplierName = strSupplierList.Item(nCurrentSupplier).Text
ActiveDocument.Fields("Final Customer Name and Number").Select strCurrentSupplierName
set obj = ActiveDocument.GetSheetObject("CH20")
obj.ExportEx strLibrary & "\" & strCurrentSupplierName & " " & strDate & ".xls",5
nCount=nCount+1
Next
MsgBox "Created " & nCount-1 & " files"
End Sub
The GetPossibleValues is limited by default to 100 values. You can add a parameter to retrieve more values. Try
Set strSupplierList = ActiveDocument.Fields("Final Customer Name and Number").GetPossibleValues(2000)
The GetPossibleValues is limited by default to 100 values. You can add a parameter to retrieve more values. Try
Set strSupplierList = ActiveDocument.Fields("Final Customer Name and Number").GetPossibleValues(2000)
Thanks! that did the trick for me!
Regards,
Martin