Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
Not applicable

Execel Export

I am very new , How to call the macro for exporting data to excel , Please give some sample it will helps

5 Replies
Highlighted
Not applicable

Execel Export

Hi Nagarajan,

You can write the macro
in Edit Module

macro to send data into Excel

Sub Sent_to_excel


Path = "C:\Documents and Settings\rlimumweb011\Desktop\testMail.xls"



set obj = ActiveDocument.GetSheetObject("CH266")

obj.ExportBiff Path

End Sub


'' path is the location where xls file will save with the given name

'' CH266 is the sheet object id

you have to change this according your requirement

and youo can call this macro on various events
as per your requirement

Hope this will help you

Thank You
Rahul

Highlighted
Not applicable

Execel Export

Thanks Rahul,

How can i call the macro to My Chat, If its possiable please help me.

I have the chat but i could able to export the data to execl(Right click)

Thanks

Highlighted
Not applicable

Execel Export

Thanks Rahul,

How can i call the macro to My Chart, If its possiable please help me.

I have the chat but i could able to export the data to execl(Right click)

Thanks

Highlighted
Not applicable

Execel Export

This just exports without saving - exports two charts one under the other (CH_Cases and CH_Handling):

sub export_summary ' macro name

set v = ActiveDocument.Variables("QvWorkPath")

set XLApp = CreateObject("Excel.Application")
XLApp.Visible =true' false
set ExcelDoc = XLApp.Workbooks.Add

call REPORTING_createSelectionSheet(ExcelDoc)
ExcelDoc.Sheets.Add

ExcelDoc.Sheets(1).activate

set obj1 = ActiveDocument.getsheetobject("CH_Cases") ' here you must enter your object name
obj1.CopyTableToClipboard true
ExcelDoc.Sheets(1).cells(1,1).select
ExcelDoc.Sheets(1).paste
ExcelDoc.Sheets(1).Rows("1:1").Font.Bold = True
'obj1.Close()
set obj1 = nothing

set obj2 = ActiveDocument.getsheetobject("CH_Handling") ' here you must enter your object name
obj2.CopyTableToClipboard true
ExcelDoc.Sheets(1).cells(25,1).select
ExcelDoc.Sheets(1).paste
ExcelDoc.Sheets(1).Rows("25:25").Font.Bold = True
'obj2.Close()
set obj2 = nothing

end sub

You must then make a button in your application and assign your macro (export_summary) to it. When your then press the button your charts are exported.

Highlighted
rohit214
Contributor III

Execel Export

hi Rahul

your macro helps me lot but i want  file name also means if i have 100 dealer so at the time of reload it should generate 100 dealer report with with ddiffrent file name.(filename_DEALERNAME.xls)

thanks

rohit