<?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: Excel to word macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246112#M268584</link>
    <description>I don't know the VBA actually... trying to get help from Google. Thank you for your suggestions though.</description>
    <pubDate>Tue, 26 Jan 2016 16:04:37 GMT</pubDate>
    <dc:creator>khalidamin</dc:creator>
    <dc:date>2016-01-26T16:04:37Z</dc:date>
    <item>
      <title>Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246098#M268582</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if this is the right group to post this problem. I am using a macro to generate Word report from Excel. The Excel file contains many graphs. When the Word report is generated, all the graphs convert into image and won't allow me to formate the graphs&amp;nbsp;in Word. I am pasting few lines of the macro if someone can help me regarding the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/* Copy into Picture */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; %if &amp;amp;type0=C %then %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; *formats the data in excel.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; file Excel;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[workbook.activate("sheet1")]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[select("'"&amp;amp;range0."'")]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[copy]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; *pastes the data into word.;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; file WORD;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[EditGoTo.Destination = "'"&amp;amp;bookmark0."'"]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[EditPasteSpecial.DataType:="PICT"]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; put '[CharLeft 1,1]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; *if &amp;amp;color0.=1 then put '[FormatPic]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; *put '[FormatPicture.Scalex="'"%left(&amp;amp;width0.)"'", .ScaleY="'"%left(&amp;amp;height0.)"'"]';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; %end;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate help and support from the community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Khalid&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 15:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246098#M268582</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2016-01-26T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246100#M268583</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not really, this is a forum for the SAS product. &amp;nbsp;I would ask however, why are you using SAS to write Excel commands to create a Word file? &amp;nbsp;This seems a bit convoluted. &amp;nbsp;I would suggest you would be better off not using SAS (which just adds another layer in), and use VBA within Excel, although why you don't go directly from source to output format is also another question.&lt;/P&gt;
&lt;P&gt;In VBA (doesn't have to be associated with the source datafile), you could just do, something like:&lt;A href="http://www.thespreadsheetguru.com/blog/2014/5/22/copy-paste-an-excel-table-into-microsoft-word-with-vba" target="_blank"&gt;http://www.thespreadsheetguru.com/blog/2014/5/22/copy-paste-an-excel-table-into-microsoft-word-with-vba&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;First search off Google.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply put, use the right technology for the right task, or in this case, go back to the souce and generate outputs from that.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 15:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246100#M268583</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-26T15:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246112#M268584</link>
      <description>I don't know the VBA actually... trying to get help from Google. Thank you for your suggestions though.</description>
      <pubDate>Tue, 26 Jan 2016 16:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246112#M268584</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2016-01-26T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246119#M268585</link>
      <description>&lt;P&gt;You do know that the SAS code you have posted, is just putting out VBA code to the Excel object? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't know VBA, it is very simple, you can record macros within Excel which will generate code for you as you do the process. &amp;nbsp;Plus there is vast amounts of code out there on Google.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 16:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246119#M268585</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-26T16:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246130#M268586</link>
      <description>&lt;P&gt;There isn't a simple native way to get an Excel file to Word and likely maintain your charts as Excel objects. You'll probably find a faster solution if you try to modify the graphs in Excel and then create your Word file from that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only method I can think of is a macro that would copy and paste all objects into a Word template. It could be done, but I imagine it would be a lot of work, to get the positioning and formatting correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: It does look like that's what your code is attempting. Your problem now is modifying the graph section to embed the graph rather than an image. This would actually be a VB problem and you're better off asking in those forums. SAS just happens to be an middleman in the process here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's one example.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/22871774/copy-and-paste-an-excel-chart-with-a-vba-macro-in-word" target="_blank"&gt;http://stackoverflow.com/questions/22871774/copy-and-paste-an-excel-chart-with-a-vba-macro-in-word&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess would be playing with the DATATYPE option will be what changes your type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 16:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246130#M268586</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-26T16:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to word macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246386#M268587</link>
      <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you for your suggestions. I played with the DATATYPE options, but no luck. Thank you once again.</description>
      <pubDate>Wed, 27 Jan 2016 16:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-word-macro/m-p/246386#M268587</guid>
      <dc:creator>khalidamin</dc:creator>
      <dc:date>2016-01-27T16:27:05Z</dc:date>
    </item>
  </channel>
</rss>

