<?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 Macro Export to CSV issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838306#M1215082</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a button that I want to export a table to CSV, I've got it but the issue is that it puts speech marks around any lines with the names with apostrophes. The code I have is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set obj = ActiveDocument.GetSheetObject("CH17")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Obj.Export vUserPath &amp;amp;"\Latest - HR Import Users - " &amp;amp; vToday &amp;amp; ".csv", ", "&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vUserPath is the filepath and vToday is the date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So someone with the name of O'Leary will appear as "O'Leary" within the exported CSV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 11:05:09 GMT</pubDate>
    <dc:creator>vinesh_panchal</dc:creator>
    <dc:date>2021-09-22T11:05:09Z</dc:date>
    <item>
      <title>Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838306#M1215082</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a button that I want to export a table to CSV, I've got it but the issue is that it puts speech marks around any lines with the names with apostrophes. The code I have is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set obj = ActiveDocument.GetSheetObject("CH17")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Obj.Export vUserPath &amp;amp;"\Latest - HR Import Users - " &amp;amp; vToday &amp;amp; ".csv", ", "&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vUserPath is the filepath and vToday is the date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So someone with the name of O'Leary will appear as "O'Leary" within the exported CSV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 11:05:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838306#M1215082</guid>
      <dc:creator>vinesh_panchal</dc:creator>
      <dc:date>2021-09-22T11:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838560#M1215108</link>
      <description>&lt;P&gt;AFAIK it's not possible because it's a not customizable feature from the underlying windows library. An alternatively would be not to export the object else to write the content like you want. See here how it could be done:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Export-to-CSV-with-quotation-marks/td-p/1138389" target="_blank"&gt;Solved: Export to CSV with quotation marks - Qlik Community - 1138389&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 07:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838560#M1215108</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-23T07:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838584#M1215113</link>
      <description>&lt;P&gt;Thanks Marcus, I did try the export function in the sense of the code opening up excel and pasting the table then saving it as a CSV file, but for some reason it appears as an excel file although the details state its a CSV, then when i go to open the file it states there could be an error as the file does not match the format.&amp;nbsp; - this is what I've tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set XLSheets = XLDoc.Worksheets("Master")&lt;BR /&gt;ActiveDocument.GetSheetObject("CH17").CopyTableToClipBoard TRUE&lt;BR /&gt;XLDoc.Sheets("Master").Activate&lt;BR /&gt;XLSheets.Paste XLSheets.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;XLDoc.SaveAs vUserPath &amp;amp;"\Latest - HR Import Users - " &amp;amp; vToday &amp;amp; ".csv"&lt;BR /&gt;oApp.Application.Quit&lt;BR /&gt;SET XLDoc = NOTHING&lt;BR /&gt;SET oApp = NOTHING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 08:51:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838584#M1215113</guid>
      <dc:creator>vinesh_panchal</dc:creator>
      <dc:date>2021-09-23T08:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838588#M1215115</link>
      <description>&lt;P&gt;Looks like you opened an Excel and pasted the content there - the result will be an Excel file unless you also changes the file-format before saving the file. I think a quick google research will give the hints how it might be done.&lt;/P&gt;&lt;P&gt;But this wasn't meant as I referred to write the content else this part from the link:&lt;/P&gt;&lt;P&gt;sub CSVEportWithQuotes&lt;/P&gt;&lt;P&gt;set table = ActiveDocument.GetSheetObject( "TB14" )&lt;/P&gt;&lt;P&gt;for RowIter = 0 to table.GetRowCount-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for ColIter =0 to table.GetColumnCount-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set cell = table.GetCell(RowIter,ColIter)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ColIter &amp;lt; table.GetColumnCount-1 then vDelimiter = "," else: vDelimiter = ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vContent = vContent &amp;amp; """" &amp;amp; cell.Text &amp;amp; """" &amp;amp; vDelimiter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vContent = vContent &amp;amp; chr(10)&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;msgbox vContent&lt;/P&gt;&lt;P&gt;set fso = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;set File = fso.OpenTextFile("\\YourServer\d\Test.csv", 2, true)&lt;/P&gt;&lt;P&gt;File.Writeline vContent&lt;/P&gt;&lt;P&gt;File.Close&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 09:00:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838588#M1215115</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-23T09:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838960#M1215139</link>
      <description>&lt;P&gt;Thank you so much for the help, I've tried it with a chart (straight table), and its taking a long time and then QlikView freezes - i've even tried doing the file to the C drive but it just freezes and keeps going in circles.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 09:15:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838960#M1215139</guid>
      <dc:creator>vinesh_panchal</dc:creator>
      <dc:date>2021-09-24T09:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Export to CSV issue</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838966#M1215141</link>
      <description>&lt;P&gt;Put some more msgbox into the script to see until the code runs like expected. Your description sounds a bit as if the loop didn't end. Therefore tracing the loop-variables with the msgbox should show this. Further helpful may be to comment the origin for-calls with something:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;for RowIter = 0 to 1&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;just to check that's in general worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 09:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Export-to-CSV-issue/m-p/1838966#M1215141</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-09-24T09:38:06Z</dc:date>
    </item>
  </channel>
</rss>

