<?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 Run Excel macro from QV macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759829#M1042334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a Straight Table in QV which I export to Excel using a macro. Next, I want to run a macro called 'Template' in Excel that I saved into my Personal Workbook in a module called 'Template'. This macro structures the exported table in Excel.&lt;/P&gt;&lt;P&gt;Although I've tried a lot, I always get the following error:&lt;/P&gt;&lt;P&gt;'Cannot run the macro 'Test.xlsm!Template.Template'. The macro may not be available in this workbook or all macros may be disabled.'&lt;/P&gt;&lt;P&gt;In the opened file I cannot see any macros either. So it seems that my Personal Workbook is not available or hidden but I cannot unhide anything in the View menu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro in QV:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub exportExcel &lt;/P&gt;&lt;P&gt;&amp;nbsp; set obj = ActiveDocument.GetSheetObject( "CH993" )&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLApp.Visible = True&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLDoc = XLApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLSheet = XLDoc.Worksheets(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; obj.CopyTableToClipboard true &lt;/P&gt;&lt;P&gt;&amp;nbsp; XLSheet.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLSheet.SaveAs "Test.xlsm", 52&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLApp.Application.Run "Test.xlsm!Template.Template"&lt;/P&gt;&lt;P&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I close the Excel file, open the Excel file, close it again and open it again (I know, it sounds stupid..) I suddenly can run the macro in the saved file by hand!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to execute the macro in Excel directly from the QV macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2020 18:02:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-20T18:02:30Z</dc:date>
    <item>
      <title>Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759829#M1042334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a Straight Table in QV which I export to Excel using a macro. Next, I want to run a macro called 'Template' in Excel that I saved into my Personal Workbook in a module called 'Template'. This macro structures the exported table in Excel.&lt;/P&gt;&lt;P&gt;Although I've tried a lot, I always get the following error:&lt;/P&gt;&lt;P&gt;'Cannot run the macro 'Test.xlsm!Template.Template'. The macro may not be available in this workbook or all macros may be disabled.'&lt;/P&gt;&lt;P&gt;In the opened file I cannot see any macros either. So it seems that my Personal Workbook is not available or hidden but I cannot unhide anything in the View menu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro in QV:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub exportExcel &lt;/P&gt;&lt;P&gt;&amp;nbsp; set obj = ActiveDocument.GetSheetObject( "CH993" )&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLApp.Visible = True&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLDoc = XLApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp; set XLSheet = XLDoc.Worksheets(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; obj.CopyTableToClipboard true &lt;/P&gt;&lt;P&gt;&amp;nbsp; XLSheet.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLSheet.SaveAs "Test.xlsm", 52&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLApp.Application.Run "Test.xlsm!Template.Template"&lt;/P&gt;&lt;P&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I close the Excel file, open the Excel file, close it again and open it again (I know, it sounds stupid..) I suddenly can run the macro in the saved file by hand!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to execute the macro in Excel directly from the QV macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2020 18:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759829#M1042334</guid>
      <dc:creator />
      <dc:date>2020-11-20T18:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759830#M1042335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi try the below code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;Set XLTemplate = XLApp.Workbooks.Open("C:\Qlikview\Temp.xls")&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;XLTemplate.Application.Run "StopCalculation"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Harsha&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 13:30:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759830#M1042335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T13:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759831#M1042336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response Harsha.&lt;/P&gt;&lt;P&gt;I don't know whether I interpreted your code as you meant, because unfortunately it does not work..&lt;/P&gt;&lt;P&gt;I added the following sub in QV and executed it after I executed the first macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub test&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set XLTemplate = XLApp.Workbooks.Open("Test.xlsm")&lt;/P&gt;&lt;P&gt;&amp;nbsp; XLTemplate.Application.Run "Template"&lt;/P&gt;&lt;P&gt;End Sub &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 13:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759831#M1042336</guid>
      <dc:creator />
      <dc:date>2014-12-02T13:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759832#M1042339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insted of adding the workbook in macro&lt;/P&gt;&lt;P&gt;create a blank workbook with only macro and then try openning it and paste the chart and then run the macro &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you tell me exact what you want i can help you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harsha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 14:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759832#M1042339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T14:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759833#M1042340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Harsha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make it possible that the user clicks on a button in QV, which exports the Straight Table to an Excel-file. However, the user needs the data from the table in another template. So I wrote a macro in Excel that changes the table in Excel to this template.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I want that when the user clicks on the button in QV:&lt;/P&gt;&lt;P&gt;1. Table is exported to Excel&lt;/P&gt;&lt;P&gt;2. Macro in Excel is executed automatically&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I'm more clear now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 14:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759833#M1042340</guid>
      <dc:creator />
      <dc:date>2014-12-02T14:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759834#M1042341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;then there are 2 ways od doing it &lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;if you have good knowledge in Excel Vba then try to convert Vba code into Vb script(Qv macros) to create the required template on the fly&amp;nbsp; which is little bit tough&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;provide a blank template with only macro and export it to that empty template and then save it as different one and then run the macro in it which most of us use&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harsha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 15:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759834#M1042341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T15:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Run Excel macro from QV macro</title>
      <link>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759835#M1042342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I just began a few weeks ago with working with macros!&lt;/P&gt;&lt;P&gt;The second option works and is simple. I thought that the macros I have saved in my Personal Workbook should always be available when a Excel file is opened. But apperently I'm wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 15:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-Excel-macro-from-QV-macro/m-p/759835#M1042342</guid>
      <dc:creator />
      <dc:date>2014-12-02T15:21:49Z</dc:date>
    </item>
  </channel>
</rss>

