<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Export into Excel by using macro but number format different in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-into-Excel-by-using-macro-but-number-format-different/m-p/576573#M214517</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to export the straight table with caption into Excel by using macro but it does not export the format of the amount even I have do the number format setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;The amount in straight table with the format (#,##0.00 ) is 1,000.00.&lt;/P&gt;&lt;P&gt;After I use the macro to export it to excel, the amount is 1000 without the number format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached file is the sample QlikView document and the following is my macro script:&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Sub ExcelExpwCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Excel spreadsheet &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Visible = true&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the WorkBook&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = excelFile.WorkBooks.Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Sheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curSheet = curWorkBook.WorkSheets(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Get the chart we want to export&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set tableToExport = ActiveDocument.GetSheetObject("CH01")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set chartProperties = tableToExport.GetProperties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableToExport.CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Get the caption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chartCaption = tableToExport.GetCaption.Name.v&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MsgBox chartCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set the first cell with the caption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Range("A1") = chartCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Paste the rest of the chart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Paste curSheet.Range("A2")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Visible = true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Cleanup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub &lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Apr 2014 07:33:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-04-15T07:33:08Z</dc:date>
    <item>
      <title>Export into Excel by using macro but number format different</title>
      <link>https://community.qlik.com/t5/QlikView/Export-into-Excel-by-using-macro-but-number-format-different/m-p/576573#M214517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to export the straight table with caption into Excel by using macro but it does not export the format of the amount even I have do the number format setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;The amount in straight table with the format (#,##0.00 ) is 1,000.00.&lt;/P&gt;&lt;P&gt;After I use the macro to export it to excel, the amount is 1000 without the number format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached file is the sample QlikView document and the following is my macro script:&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Sub ExcelExpwCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Excel spreadsheet &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Visible = true&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the WorkBook&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = excelFile.WorkBooks.Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Sheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curSheet = curWorkBook.WorkSheets(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Get the chart we want to export&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set tableToExport = ActiveDocument.GetSheetObject("CH01")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set chartProperties = tableToExport.GetProperties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableToExport.CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Get the caption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chartCaption = tableToExport.GetCaption.Name.v&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MsgBox chartCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set the first cell with the caption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Range("A1") = chartCaption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Paste the rest of the chart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Paste curSheet.Range("A2")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Visible = true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Cleanup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub &lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2014 07:33:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-into-Excel-by-using-macro-but-number-format-different/m-p/576573#M214517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-15T07:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export into Excel by using macro but number format different</title>
      <link>https://community.qlik.com/t5/QlikView/Export-into-Excel-by-using-macro-but-number-format-different/m-p/576574#M214518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try adding this code in Maco after &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; "curSheet.Paste curSheet.Range("A2")"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Specify the Range to Format the data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Range("C2:C60").NumberFormat = "#,##0.00;[Red]#,##0.00"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Purushotham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 09:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-into-Excel-by-using-macro-but-number-format-different/m-p/576574#M214518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-23T09:59:53Z</dc:date>
    </item>
  </channel>
</rss>

