Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Ribeiro
Specialist
Specialist

Export excel with header formatting

I would like to export the formatting of the same qlik to Excel.

I had seen something right here on the forum. But I did not find it.

I'm using the macro below. I need to do this automatically by firing.

Anyone have any suggestions?

2018-05-13_09-48-50.jpg

2018-05-13_09-49-23.jpg

Sub ExcelExpwCaption

     'Defina o caminho onde o excel será salvo

     filePath = "C:\exportar\Test.xlsx"

    'Crie a planilha do Excel

     Set excelFile = CreateObject("Excel.Application")

     excelFile.Visible = true

     'Crie o WorkBook

     Set curWorkBook = excelFile.WorkBooks.Add

     'Crie a folha

     Set curSheet = curWorkBook.WorkSheets(1)

     'Pegue o gráfico que queremos exportar

     Set tableToExport = ActiveDocument.GetSheetObject("CH01")

     Set chartProperties = tableToExport.GetProperties

     tableToExport.CopyTableToClipboard true

     'Obter a legenda

     chartCaption = tableToExport.GetCaption.Name.v

     'MsgBox chartCaption

     ''Defina a primeira célula com a legenda

  

     curSheet.Paste curSheet.Range("A7")

     excelFile.Visible = true

     'Salve o arquivo e saia do excel

     curWorkBook.SaveAs filePath

     curWorkBook.Close

     excelFile.Quit

     'Limpar

     Set curWorkBook = nothing

     Set excelFile = nothing

End Sub

Neves
1 Solution

Accepted Solutions
adityaakshaya
Creator III
Creator III

Hi Agnaldo,

I would like you to suggest to use Nprinting for such requirements. Using Nprinting you can achieve a better solution which will be far stable than macros.

Regards,

Akshaya

View solution in original post

1 Reply
adityaakshaya
Creator III
Creator III

Hi Agnaldo,

I would like you to suggest to use Nprinting for such requirements. Using Nprinting you can achieve a better solution which will be far stable than macros.

Regards,

Akshaya