<?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: Dynamic column size in excel macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-column-size-in-excel-macro/m-p/949171#M649957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worksheets("Sheet1").Columns("A:I").AutoFit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AutoFit is a method that can be used on an Excel Range object. So maybe:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curSheet.UsedRange.AutoFit &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Aug 2015 21:09:51 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2015-08-18T21:09:51Z</dc:date>
    <item>
      <title>Dynamic column size in excel macro</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-column-size-in-excel-macro/m-p/949170#M649956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using macro below and it is working, but the file is generated with default column size insted of dynamic column size (according to text size). How can I fix this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub SendToExcel&lt;/P&gt;&lt;P&gt;'Set the path where the excel will be saved&lt;/P&gt;&lt;P&gt;filePath = "Z:\Qlikview\Reports\Follow Up.xlsx"&lt;/P&gt;&lt;P&gt;'Create the Excel spreadsheet&lt;/P&gt;&lt;P&gt;Set excelFile = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;excelFile.Visible = true&lt;/P&gt;&lt;P&gt;'Create the WorkBook&lt;/P&gt;&lt;P&gt;Set curWorkBook = excelFile.WorkBooks.Add&lt;/P&gt;&lt;P&gt;'Create the Sheet&lt;/P&gt;&lt;P&gt;'First chart object&lt;/P&gt;&lt;P&gt;Set curSheet = curWorkBook.WorkSheets(1)&lt;/P&gt;&lt;P&gt;curWorkBook.Sheets(1).Name = "Follow up"&lt;/P&gt;&lt;P&gt;curWorkBook.Sheets(2).Delete&lt;/P&gt;&lt;P&gt;curWorkBook.Sheets(2).Delete&lt;/P&gt;&lt;P&gt;curWorkBook.Sheets(1).Range("A1").Select&lt;/P&gt;&lt;P&gt;'loop&lt;/P&gt;&lt;P&gt;chartArray = Array("CHTabelalDinamica")&lt;/P&gt;&lt;P&gt;usedRows=0&lt;/P&gt;&lt;P&gt;For Each chart In chartArray&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set i = ActiveDocument.GetSheetObject(chart)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chartCaption = i.GetCaption.Name.v&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Cells(usedRows+1, 1)=chartCaption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i.CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Cells(usedRows+2, 1).Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usedRows=curSheet.UsedRange.Rows.Count+3 '---&amp;gt;function to get the first unused row&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;'loop end&lt;/P&gt;&lt;P&gt;excelFile.Visible = true&lt;/P&gt;&lt;P&gt;'Save the file and quit excel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curWorkBook.SaveAs filePath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curWorkBook.Close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Quit&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;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 21:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-column-size-in-excel-macro/m-p/949170#M649956</guid>
      <dc:creator>danielpereira</dc:creator>
      <dc:date>2015-08-18T21:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic column size in excel macro</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-column-size-in-excel-macro/m-p/949171#M649957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worksheets("Sheet1").Columns("A:I").AutoFit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AutoFit is a method that can be used on an Excel Range object. So maybe:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curSheet.UsedRange.AutoFit &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 21:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-column-size-in-excel-macro/m-p/949171#M649957</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-08-18T21:09:51Z</dc:date>
    </item>
  </channel>
</rss>

