Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

Export to Microsoft Excel button grayed out!

Hello friends. I have tried to create a button to export a document or anything else to a microsoft excel application, but my botton is always grayed out and i can't do anything to revert that. My co-workers have succeeded, but i have not and i feel ashamed to ask how they did.

this is what i did. New folder object > button > I give it a name > actions > include > external > run macro > edit module >

Sub Exportar_Objetos_Excel

'Setando o Objeto que será exportado

  Set Objetos = ActiveDocument.GetSheetObject("CH01")

'Definições do arquivo Excel

  Set XLApp = CreateObject("Excel.Application")

  Set XLDoc  = XLApp.Workbooks.Add

  Set XLSheet = XLDoc.Worksheets(1)

  XLApp.Visible = True

'Selecionando e excluido as bordas de toda a Aba Excel

  XLApp.Cells.Select

     XLApp.ActiveWindow.DisplayGridlines = False

'Selecionando a Célula A1 e colando o conteúdo do Objeto CH01

  XLApp.Range("A5").Select

'Para exportar os dados como tabela utilize o CopyTableToClipboard

'  ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard True

'Para exportar o gráfico como imagem utilize o CopyBitMapToClipboard  

  ActiveDocument.GetSheetObject("CH01").CopyBitMapToClipboard

  XLSheet.Paste

'Selecionando a célula A1

  XLSheet.Range("A1").Select

End Sub

I verify, it's ready but when i test it, it says : the ActiveX cannot create the object : 'Excel.Application'

I don't know how to do that neither for a Word document. Help me out please. Thank you all

4 Replies

Re: Export to Microsoft Excel button grayed out!

Is Excel installed on the machine where you try that? And did you change the security settings in the Qlikview document to allow System Access for the macro?

comm209935.png


talk is cheap, supply exceeds demand
Not applicable

Re: Export to Microsoft Excel button grayed out!

Yes friend! I did, everything seems fine but still have a grayed out button

Re: Export to Microsoft Excel button grayed out!

Can you post a small qlikview document that demonstrates the problem.


talk is cheap, supply exceeds demand
ceciliafujita
New Contributor III

Re: Export to Microsoft Excel button grayed out!

It worked here with the Gysbert tip.

Community Browser