<?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: Cannot save file and close application using winword 2007 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231845#M1524936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;I just found an amazing program by Y.SAITA at erpgenie.com.

While it appears I've clobbered something in my code snippet above by opening the workbook,
Y.SAITA's program data comes from the clipboard and the following works:

h_workbook type ole2_object, "WORKBOOK

cos_saveas type sychar32 value 'SaveAs',
cos_xlworkbook type i value -4143, "*.xls


call function 'FLUSH'
exceptions
cntl_system_error = 1
cntl_error = 2
others = 3.
if sy-subrc = 0.
call method of h_workbook cos_saveas
exporting
#1 = p_file
#2 = cos_xlworkbook.
endif.
(further error checking)


Also, all the other Excel-related methods carry the 'no flush' option.

I'm so confused, but now can do what I needed to.

Still appreciate more of your thoughts, however.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, if you get to know the answer please share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Veeranji Reddy P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Aug 2010 09:25:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-11T09:25:36Z</dc:date>
    <item>
      <title>Cannot save file and close application using winword 2007</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231842#M1524933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a custom report that creates an MS Word file as an output. By the end of the report we need to save the MS Word file then close the MS Word application. We are able to successfully save and close in MS Word 2003 using the method below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********************&lt;/P&gt;&lt;P&gt;  CALL METHOD OF wordobj 'FileSaveAs'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;    #1 = zfilename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD OF wordobj 'FileExit'.&lt;/P&gt;&lt;P&gt;*************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are these methods not working when using MS Word 2007? Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 07:33:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231842#M1524933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T07:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot save file and close application using winword 2007</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231843#M1524934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the below link&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="831547"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Veeranji Reddy P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 08:24:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231843#M1524934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T08:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot save file and close application using winword 2007</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231844#M1524935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The questions in the thread you showed is also not answered. They are also not able to make he SaveAs method work correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 09:18:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231844#M1524935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T09:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot save file and close application using winword 2007</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231845#M1524936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;I just found an amazing program by Y.SAITA at erpgenie.com.

While it appears I've clobbered something in my code snippet above by opening the workbook,
Y.SAITA's program data comes from the clipboard and the following works:

h_workbook type ole2_object, "WORKBOOK

cos_saveas type sychar32 value 'SaveAs',
cos_xlworkbook type i value -4143, "*.xls


call function 'FLUSH'
exceptions
cntl_system_error = 1
cntl_error = 2
others = 3.
if sy-subrc = 0.
call method of h_workbook cos_saveas
exporting
#1 = p_file
#2 = cos_xlworkbook.
endif.
(further error checking)


Also, all the other Excel-related methods carry the 'no flush' option.

I'm so confused, but now can do what I needed to.

Still appreciate more of your thoughts, however.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, if you get to know the answer please share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Veeranji Reddy P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 09:25:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231845#M1524936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T09:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot save file and close application using winword 2007</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231846#M1524937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have found the solution! The issue is not a programming error. Upon further investigations, it was found that read/write permissions by the Windows user is affecting the 'FileSaveAs' method. You need to make sure that the Windows user generating the report has the permission to save files in the specified folder (file path).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Aug 2010 06:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-save-file-and-close-application-using-winword-2007/m-p/7231846#M1524937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-23T06:02:02Z</dc:date>
    </item>
  </channel>
</rss>

