Discussion Board for collaboration on QlikView Scripting.
I want to aexport table from Qlikview dshboard to excel with macro.
as i have st up chart visibility by using variable vshow and passing chart name by using button so that particular chart get visible.
Now want to export chart by using one subrutine and calling variable vshow .
i have tried but its not working,pls suggest if some one have done or any idea to do it.
SET excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
SET XLDoc = excelFile.Workbooks.Add
SET XLSheet1 = XLDoc.Worksheets(1)
excelFile.Visible = True
Did you get any error message?
The most commom problem is related to security.
You need to enable unsafe macro execution to access Excel and create a new document.
You can press Ctrl+Shift +M to check you current security level.
You can also set it on the macro module (where you wrote your macro) on the left side of the screen.
This macro will not work unless you are using the IE Plugin client.
Also, it looks like you are trying to use a QlikView variable $(vShow) in the macro. You need to load the contents of the QlikView variable into a vbscript variable.
Here is an example from the API Guide:
set v = ActiveDocument.Variables("Variable1")
strVar = .GetContent.String
set v = ActiveDocument.Variables("vshow")
strvshow = v.Getcontent.String
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
Set XLWorkbook = XLApp.Workbooks.Add
Set XLSheet = XLWorkbook.sheets("Sheet1")
XLSheet.Range("A1").Value = strvshow
where vshow variable i used to show and hide chart but above code is not working.
pls help regarding to fix the issue.
Are you trying to print the variable value in excel sheet??
i am trying to export table data into excel but i want to write only one subprogram for all chart and export which is visible at that time , i have used variable to set visibility of charts.