<?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 Overwriting Existing File on Export Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217480#M856233</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;Currently i have the below script.&amp;nbsp; All it does, is exports a table from Qlikview.&amp;nbsp; However, i need Qlikview to REPLACE the existing file without a prompt from Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLDoc.DisplayAlerts = False does not work , because although it doesn't display it, it ends up not overwriting the file autmatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDoc.DisplayAlerts = False&lt;/P&gt;&lt;P&gt;XLDoc.SaveAs "...............\Sequence.xlsx"&lt;/P&gt;&lt;P&gt;XLDoc.DisplayAlerts = True&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>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Overwriting Existing File on Export Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217480#M856233</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;Currently i have the below script.&amp;nbsp; All it does, is exports a table from Qlikview.&amp;nbsp; However, i need Qlikview to REPLACE the existing file without a prompt from Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLDoc.DisplayAlerts = False does not work , because although it doesn't display it, it ends up not overwriting the file autmatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDoc.DisplayAlerts = False&lt;/P&gt;&lt;P&gt;XLDoc.SaveAs "...............\Sequence.xlsx"&lt;/P&gt;&lt;P&gt;XLDoc.DisplayAlerts = True&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/Overwriting-Existing-File-on-Export-Macro/m-p/1217480#M856233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting Existing File on Export Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217481#M856234</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;&lt;STRONG&gt;XLApp&lt;/STRONG&gt;.DisplayAlerts = False&lt;/P&gt;&lt;P&gt;XLDoc.SaveAs "&lt;STRONG&gt;Path&lt;/STRONG&gt;\Sequence.xlsx"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XLApp&lt;/STRONG&gt;.DisplayAlerts = True&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>Mon, 06 Feb 2017 11:55:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217481#M856234</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-02-06T11:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting Existing File on Export Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217482#M856236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I tried this before, seems I put it in the wrong place.&amp;nbsp; this worked perfect thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 04:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Overwriting-Existing-File-on-Export-Macro/m-p/1217482#M856236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-07T04:42:41Z</dc:date>
    </item>
  </channel>
</rss>

