Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!!
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...
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.
Have you tried with using the Table Box object instead of ListBox?..
You can add the needed fields and export to excel.
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.
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...
Thank you for your answer! it helped a lot!
Thank you for your answer! it helped a lot!
Thank you for your answer! it helped a lot!
Thank you I will try to out!