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: 
bimartingo
Contributor III
Contributor III

Button with only Export Action

Hi,

i'm trying to use a button with the Action Export, but it's disabled (does not work) when it's the only action in the button. But i only want Qlikview to export the selected data to a delimited or csv text file, no other action.

Any alternative?

12 Replies
Not applicable

I had a button with an Export Action that was disabled. Turned out it was because I hadn't selected "Multi Value (*)" in the Export Lines.

Not applicable

You have to create a Macro and in the button object add action to call the macro name.

this example export object to excel. see

Sub Test

   ExcelAppend "C:\QlikView\Ventas\test.xls", "CH02"

End Sub

Sub ExcelAppend(strExcelAppenFile, strExelAppendObjectID) 

  

   ' Create an instance of Excel

   SET objExcelApp = CREATEOBJECT("Excel.Application") 

    

   ' Open workbook 

  ' WITH objExcelApp 

  '    .DefaultSaveFormat = xlWorkbookNormal 

  '    .DisplayAlerts = FALSE 

  '    .Workbooks.Open strExcelAppenFile 

  '    .DisplayFullScreen = FALSE 

  '    .Visible = FALSE 

  ' END WITH

  

   objExcelApp.DefaultSaveFormat = xlWorkbookNormal

   msgbox(strExcelAppenFile)

   objExcelApp.Workbooks.Open strExcelAppenFile

  ' set xlDoc =objExcelApp.Workbooks.Add

   msgbox(strExcelAppenFile)

    

   ' Set worksheet 

   SET objExcelSheet = objExcelApp.Worksheets(1) 

       

   ' Set Excel used range 

   SET objExcelRange = objExcelSheet.Range("A65535").End(-4162) 

   ' Last used row in column A 

   intExcelLastRow = objExcelRange.Row 

   ' Set object to append from 

   SET objObjectFrom = ActiveDocument.GetSheetObject(strExelAppendObjectID) 

   ' Loop all rows of the object except first header row

  

   Msgbox("Total rows = " & objObjectFrom.GetRowCount)

  

    sheetNumber = 1

    rowNumber = 1

   

   FOR intObjectRow = 1 To objObjectFrom.GetRowCount - 1

  

   msgbox(intObjectRow)

    if intObjectRow Mod 5 = 0 then

    rowNumber = 1

    msgbox("Next sheet")

    sheetNumber = sheetNumber + 1

    msgbox(sheetNumber)

    SET objExcelSheet = objExcelApp.Worksheets.Add

    ' Set Excel used range 

    SET objExcelRange = objExcelSheet.Range("A65535").End(-4162) 

    ' Last used row in column A 

    intExcelLastRow = objExcelRange.Row 

    end if

  

      ' Loop all columns of the object 

      FOR intObjectColumn = 0 To objObjectFrom.GetColumnCount - 1 

         ' Get object data 

         SET objCell = objObjectFrom.GetCell(intObjectRow, intObjectColumn) 

         ' Add that data to Excel cell 

         objExcelSheet.Cells(rowNumber + intExcelLastRow, intObjectColumn + 1) = objCell.Text 

      NEXT 

     

      rowNumber = rowNumber + 1

   NEXT 

    

   ' Save and quit 

   objExcelSheet.SaveAs strExcelAppenFile 

   objExcelApp.Application.Quit 

   SET objExcelSheet = NOTHING       

   SET objExcelApp = NOTHING 

END SUB

when you create this macro, add a button object to the QV document and in de actions tab add action in RunMacro option. then call the de macro name in this action.

I hope help you.

Anonymous
Not applicable

Use Macro