<?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 Table Box in Batches in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399664#M148716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code looks different to the code from me. Want you it solve without loop with repeat the same code several times? I don't believe this it the better way. A few trials will required with each solution ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I' m not sure whether this paste method is properly. Most often it is easier (not performanter) to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLSheet1.Activate&lt;/P&gt;&lt;P&gt;XLSheet1.Range("A1").Select&lt;/P&gt;&lt;P&gt;Selection.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try it with another object and much lesser data to see logic and syntax works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 May 2013 07:42:28 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2013-05-24T07:42:28Z</dc:date>
    <item>
      <title>Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399658#M148710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a tricky one here (for me), that I need help with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that sends a table box to Excel and saves the excel file. The table box usually has between 200,000 and 300,000 records. This causes the macro to run very long and sometimes fail. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file then also needs to be split - it is a list of customer detail which we upload to our SMS Portal to send them text messages, and we usually limit a batch to 50,000 at a time so that we do not get too many incoming calls at the same time because of the messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to amend the below macro to create separate files, each with 50,000 records, and the last file of course with how ever many records are left. If there are 210,000 I want the following Excel Files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;" Batch 1.xlsx" (50,000)&lt;/P&gt;&lt;P&gt;Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;" Batch 2.xlsx" (50,000)&lt;/P&gt;&lt;P&gt;Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;" Batch 3.xlsx" (50,000)&lt;/P&gt;&lt;P&gt;Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;" Batch 4.xlsx" (50,000)&lt;/P&gt;&lt;P&gt;Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;" Batch 5.xlsx" (10,000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible? Here is my current code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLApp = CreateObject("Excel.Application")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Visible = False&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLDoc = XLApp.Workbooks.Add&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLSheet1 = XLDoc.Worksheets(1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dtmDate = Date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strYear = year(Date)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strMonth = month(Date)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strMonth) = 1 then strMonth = "0" &amp;amp; strMonth&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strDay = day(Date()-1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strDay) = 1 then strDay = "0" &amp;amp; strDay&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;NewFileName = "C:\Documents and Settings\GERHARDL\My Documents\TENACITY\Qlikview\TEMP\Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay &amp;amp;".xlsx"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Set obj = ActiveDocument.GetSheetObject("TB01")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;obj.CopyTableToClipboard True&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLSheet1.Paste XLSheet1.Range("A1")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("A:B").ColumnWidth = 9.5&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("C:C").ColumnWidth = 3.5&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("D:E").ColumnWidth = 32&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("F:F").ColumnWidth = 5&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("G:G").ColumnWidth = 12&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("H:H").ColumnWidth = 7.5&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("I:I").ColumnWidth = 30&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("J:K").ColumnWidth = 13&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("G:G").NumberFormat = "#############"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Range("I:I").NumberFormat = "#############"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Worksheets(1).Cells.WrapText = False&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Visible = True&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLDoc.SaveAs NewFileName&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Quit&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;End Sub&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: I am currently working on Personal Edition so cannot open any of your QV Files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 10:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399658#M148710</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-23T10:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399659#M148711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simplest solution would be a calculated dimension in load, then you could use a simple excel-export in a loop through this field. Otherwise this should work with a little tuning on it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewFileName = "C:\Documents and Settings\GERHARDL\My Documents\TENACITY\Qlikview\TEMP\Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay&lt;/P&gt;&lt;P&gt;iRow = XLApp.Worksheets(1).Rows.Count&lt;/P&gt;&lt;P&gt;iFile = Application.RoundUp(iRow / 50000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to iFile - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET XLDocSplit = XLApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET XLSheetSplit = XLDocSplit.Worksheets(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheet1.Activate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheet1.Range("A1:I1").Copy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheetSplit.Activate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheetSplit.Range("A1").Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Selection.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheet1.Activate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheet1.Range(Cells((i * 50000) + 2, 1), Cells(((i + 1) * 50000) + 2, 9)).Copy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLSheetSplit.Range("A2").Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Selection.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDocSplit.SaveAs NewFileName &amp;amp; "-" &amp;amp; i &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDocSplit.Close&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&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>Thu, 23 May 2013 12:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399659#M148711</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-23T12:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399660#M148712</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;That seems a bit too difficult for someone with my QV knowledge, but I'll try that if I cannot get right what I am now attempting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea was to add a row number to each record in the load script, and then bookmark different sets (e.g. row 1 - 50,000 is bookmark1). Then I activate a bookmark, export and save, then go to the next bookmark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am obviosuly doing something wrong though. The first export and save works fine, then I select a new bookmark, and then it fails - &lt;EM&gt;&lt;STRONG&gt;Paste method of Worksheet class failed&lt;/STRONG&gt;&lt;/EM&gt;. I'm trying to attach an image but it isn't working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 13:27:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399660#M148712</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-23T13:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399661#M148713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay so my "solution" is a nightmare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus, can you please explain your suggestion(s) to me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really don't know what your first paragraph means, and your suggested macro code - not sure how that would work and where I am selecting the QlikView object to export.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 13:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399661#M148713</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-23T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399662#M148714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My suggest was after the full export to split the data in a loop and store each part in a new file. Your error message is probably only a small syntax-error. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you have a field with the "RowCluster" you can use it much easier for a selections-loop:&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;dim obj, field, i&lt;/P&gt;&lt;P style="text-align: justify;"&gt;dim NewFileName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewFileName = "C:\Documents and Settings\GERHARDL\My Documents\TENACITY\Qlikview\TEMP\Insurance SMS " &amp;amp; formatdatetime(Date, 2)&lt;/P&gt;&lt;P&gt;set field = ActiveDocument.Fields("RowCluster").GetPossibleValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to field.count - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("RowCluster").Select field.Items(i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set obj = ActiveDocument.GetSheetObject("TB01")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.ExportBiff NewFileName &amp;amp; "-" &amp;amp; i &amp;amp; ".xls"&lt;/P&gt;&lt;P&gt;next&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;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 15:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399662#M148714</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-23T15:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399663#M148715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #333333; text-indent: 0px; text-align: left;"&gt;okay so I just had row numbers, but I have now grouped them into 9 different batches as part of my load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #333333; text-indent: 0px; text-align: left;"&gt;So the field name is Batch, and I want to select each of them in turn and create 9 different excel files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #333333; text-indent: 0px; text-align: left;"&gt;I tried your code as is, and just replaced the fieldname "RowCluster" with "Batch", and I get the attached error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 17:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399663#M148715</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-23T17:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399664#M148716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code looks different to the code from me. Want you it solve without loop with repeat the same code several times? I don't believe this it the better way. A few trials will required with each solution ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I' m not sure whether this paste method is properly. Most often it is easier (not performanter) to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLSheet1.Activate&lt;/P&gt;&lt;P&gt;XLSheet1.Range("A1").Select&lt;/P&gt;&lt;P&gt;Selection.Paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try it with another object and much lesser data to see logic and syntax works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 07:42:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399664#M148716</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-24T07:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399665#M148717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I loaded the wrong picture! See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 08:26:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399665#M148717</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-24T08:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399666#M148718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it was not complete:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Batch").Select field.Items(i)&lt;STRONG&gt;.Text&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 08:33:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399666#M148718</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-24T08:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399667#M148719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still get the same error message - Object doesn't support this property or method: 'field.Items'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 08:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399667#M148719</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-24T08:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399668#M148720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry Item instead Items:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Batch").Select field.&lt;STRONG&gt;Item(i)&lt;/STRONG&gt;&lt;STRONG&gt;.Text&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 08:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399668#M148720</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-24T08:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399669#M148721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay it executed now (took about 10 minutes), and I can see that it went through the different selections. Batch number 9 (the last one) was left selected after the macro finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are no excel files created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 09:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399669#M148721</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-24T09:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399670#M148722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only selections could not take 10 minutes - check again the path.&lt;/P&gt;&lt;P&gt;To remove the last selection: ActiveDocument.Fields("Batch").Clear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 09:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399670#M148722</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-05-24T09:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table Box in Batches</title>
      <link>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399671#M148723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay 10 minutes was not totally true. I timed it now and execution takes 2 minutes and 40 seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still nothing in the folder, so I removed the date from the field name amd changed how the date is chose. and now it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the final code if someone else needs it. Thanks so much for all your help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have just one more question. In the Excel file, Column G is an account number with between 13 and 20 characters. Whenever I do a macro export the formatting doesn't remain text, it changes to something like &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="113"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="17" width="113"&gt;1.11001E+12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you amend the macro code to keep this in text format so the full account number shows in Excel, like this:&lt;/P&gt;&lt;P&gt;10201205040001512426&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current code that works (except for account number format)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;sub export&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dtmDate = Date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strYear = year(Date)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strMonth = month(Date)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strMonth) = 1 then strMonth = "0" &amp;amp; strMonth&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;strDay = day(Date()-1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strDay) = 1 then strDay = "0" &amp;amp; strDay&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dim obj, field, i&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;dim NewFileName&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;NewFileName = "C:\Documents and Settings\GERHARDL\My Documents\TENACITY\Qlikview\TEMP\Insurance SMS " &amp;amp; strYear &amp;amp; strMonth &amp;amp; strDay&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;set field = ActiveDocument.Fields("Batch").GetPossibleValues&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;for i = 0 to field.count - 1&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Batch").Select field.Item(i).Text&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set obj = ActiveDocument.GetSheetObject("TB01")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.ExportBiff NewFileName &amp;amp; "- " &amp;amp; i &amp;amp; ".xls"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;next&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; ActiveDocument.Fields("Batch").Clear&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;end sub&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 09:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-Table-Box-in-Batches/m-p/399671#M148723</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-05-24T09:48:20Z</dc:date>
    </item>
  </channel>
</rss>

