Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

exporting to excel file

I am pulling a table directly from Database.

the original table has 50 columns.

I have only pulled 10 columns to QV.

and among the 10 columns I am only pulling 2 columns to the dashboard by listbox.

I want to make a shortcut that extracts the 10 columns and all the rows to excel file.

but when I right click the list box which only contains one column information, only one column is exoprted to excel file.

Is there any way i can make short cut to export all 10 columns to excel file?

Thank you in advance!!

1 Solution

Accepted Solutions
avinashelite

Create a table box and add all the required columns into it and then export the same to excel you will get all the data you want...

View solution in original post

8 Replies
tamilarasu
Champion
Champion

Hi David,

You can use macro to export specific list boxes into excel. I have attached a sample VB script.

Sub Export

Dim XLApp

Set XLApp = CreateObject("Excel.Application")

XLApp.Visible = False

Set XLDoc = XLApp.Workbooks.Add

set XLSheet = XLDoc.Worksheets(1)

********** Type your listbox object ID's in array******

ColArray = ARRAY("LB01", "LB02")

ColNum = 1

For Each Tmp in ColArray

set obj = ActiveDocument.GetSheetObject(Tmp)

obj.CopyTableToClipboard true

XLSheet.Cells(1,ColNum).Select

XLSheet.Paste()

ColNum = ColNum + 1

Next


XLSheet.Cells(1,1).Select

XLDoc.SaveAs "C:\Users\Tamilarasu.Nagaraj\Desktop\Test\Test.xlsx"

XLApp.Application.quit

set XLApp = Nothing

set XLDoc = Nothing

set XLSheet = Nothing

Msgbox "Exported Sucessfully"

End sub

If you have any issues, let me know.

settu_periasamy
Master III
Master III

Have you tried with using the Table Box object instead of ListBox?..

You can add the needed fields and export to excel.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a Table Box object and add all the fields you required and export it to excel.  List object can hold only one field value.

Regards,

jagan.

avinashelite

Create a table box and add all the required columns into it and then export the same to excel you will get all the data you want...

Not applicable
Author

Thank you for your answer! it helped a lot!

Not applicable
Author

Thank you for your answer! it helped a lot!

Not applicable
Author

Thank you for your answer! it helped a lot!

Not applicable
Author

Thank you I will try to out!