Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
phil_asmar
Partner - Contributor III
Partner - Contributor III

Export Table to Excel File

Hi

I have a table on qlikview and i want to export it to an excel file using a macro (or any other way if available). I want to input the name of the excel file and let it save without having qlikview opening the excel file and asking me to save.

Is there any way to do so?

I have looked around through the community but non of the proposed solutions worked.

Any help would be appreciated!!

Thank youu

I have found a solution and this is what I used:

FUNCTION CallExport()

   ExcelExport( "TB01" )

END FUNCTION

'This is the export function

FUNCTION ExcelExport(objID)

'obj gets the table from qlikview

  set obj = ActiveDocument.GetSheetObject( objID )

  'get the number of columns

  w = obj.GetColumnCount

  'get the number of rows

  h= obj.GetRowCount

  'set the file path of the document you want to write in

  filePath = "..\Desktop\sourcePort.xlsx"

  'create a new excel application to write in

  Set objExcel = CreateObject("Excel.Application")

  'open the document in the application

  objExcel.Workbooks.Open(filePath)

  'select the fields to write in

  objExcel.Worksheets(1).select()

  'clear all the sheet to remove old data

  objExcel.Worksheets(1).Cells.Clear

  'set it as a visible document

  objExcel.Visible = True

  'choose the boundaries of the data of qlikview table

  set CellMatrix = obj.GetCells2(0,0,w,h)

  'Below you start copying one cell at a time, iteratively by row and column

  column = 1

  for cc=0 to w-1

   objExcel.Cells(1,column).Value = CellMatrix(0)(cc).Text

   objExcel.Cells(1,column).EntireRow.Font.Bold = True

   column = column +1

  next

  c = 1

  r =2

  for RowIter=1 to h-1

    for ColIter=0 to w-1

      objExcel.Cells(r,c).Value = CellMatrix(RowIter)(ColIter).Text

      c = c +1

    next

   r = r+1

   c = 1

next

'save the sheet onto the previous data

objExcel.Workbooks(1).Save

'close the excel application

objExcel.Workbooks(1).Close

END FUNCTION

Message was edited by: Phil Asmar

5 Replies
mkas0001
Contributor III
Contributor III

Hi,

I sometimes use Easy Morph application

mkas0001
Contributor III
Contributor III

Maybe something like this (no macro, variable vFileName and button with export to csv) ?

Button.png

Anonymous
Not applicable

instead of Macro, Qlikview recently introduced Nprinting tool which has lot of power in it. It can export any piece of information from qlikview and store it in excel or pdf or even send to users in the form of email on scheduled basis. the license cost is also cheaper.

mkas0001
Contributor III
Contributor III

Vinay, you are right

I really wonder about buying NPrinting

Anonymous
Not applicable

yeah we had similar kind of requirement in our environment. So we initially worked with trial version. It is kind of the right tool for this job then we immediately bought this. I think Nprinting brings a lot to the table buddy