<?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 Re: Export Format Different From XLS Button in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224487#M858001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it with pastespecial instead of paste:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/de-de/library/office/ff839476.aspx" title="https://msdn.microsoft.com/de-de/library/office/ff839476.aspx"&gt;Range.PasteSpecial-Methode (Excel)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2017 08:46:59 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2017-02-07T08:46:59Z</dc:date>
    <item>
      <title>Export Format Different From XLS Button</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224484#M857998</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;I have created a macro with the below Code.&amp;nbsp; This simply exports a single table with two columns.&amp;nbsp; However, i need the export to be exactly the same format as the table.&amp;nbsp; When I use the XLS export on the table itself, it exports in the correct format, but with the macro it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data looks like the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;0002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i use the XLS Button as mentioned before i get the above result, the macro however, does the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to correct this?&amp;nbsp; Below is my macro code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Export&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;XLApp.Visible = True 'you can make it false, if you want to make it in the background&lt;/P&gt;&lt;P&gt;set XLDoc = XLApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(1).name = "Export"&lt;/P&gt;&lt;P&gt;set XLSheet = XLDoc.Worksheets(1)&lt;/P&gt;&lt;P&gt;set MyTable = ActiveDocument.GetSheetObject("TB01") 'Change TB01 to the object you want to export to Excel (Object Properties &amp;gt; General tab &amp;gt; far right)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted&lt;/P&gt;&lt;P&gt;Mytable.CopyTableToClipboard true 'Copy data to Clipboard&lt;/P&gt;&lt;P&gt;XLSheet.Paste XLSheet.Range("A1") 'Paste data starting at A1&lt;/P&gt;&lt;P&gt;XLApp.DisplayAlerts = False&lt;/P&gt;&lt;P&gt;XLDoc.SaveAs "C:\Users\ruangreeff\Desktop\QVData\QVLive\ExternalData\Heatmap\Sequence.xls"&lt;/P&gt;&lt;P&gt;XLApp.DisplayAlerts = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224484#M857998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export Format Different From XLS Button</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224485#M857999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted&lt;/P&gt;&lt;P&gt;Mytable.CopyTableToClipboard true 'Copy data to Clipboard&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XLSheet.Columns("A:A").EntireColumn.NumberFormat = "@" 'as text&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'XLSheet.Columns("A:A").EntireColumn.NumberFormat = "0000" 'as number&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;XLSheet.Paste XLSheet.Range("A1") 'Paste data starting at A1&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 08:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224485#M857999</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-02-07T08:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export Format Different From XLS Button</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224486#M858000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This did not seem to work.&amp;nbsp; I tried keeping it as text.&amp;nbsp; But as mentioned earlier, the format of the actual field was set in the script to text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if the '@' might have to be replaced with something else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 08:28:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224486#M858000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-07T08:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export Format Different From XLS Button</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224487#M858001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it with pastespecial instead of paste:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/de-de/library/office/ff839476.aspx" title="https://msdn.microsoft.com/de-de/library/office/ff839476.aspx"&gt;Range.PasteSpecial-Methode (Excel)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 08:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224487#M858001</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-02-07T08:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export Format Different From XLS Button</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224488#M858002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help.&amp;nbsp; You wont believe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i fixed the issue with the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub exportToExcel()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set obj = ActiveDocument.GetSheetObject("TB01")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obj.ExportBiff "..........\Sequence.xls"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set obj = nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 12:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Format-Different-From-XLS-Button/m-p/1224488#M858002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-07T12:43:58Z</dc:date>
    </item>
  </channel>
</rss>

