02-11-2016 10:38 AM
Dear Experts,
I am having program to create word Document using OLE. Program was working perfectly earlier (Microsoft 2010) before updating Microsoft 2016.
Program is working fine on local machine having Microsoft 2010 / 2013 but throwing error on machine having Microsoft 2016.
Program functionality:
Program create one .txt file at local machine and then convert this file in to .doc file and Replace/Delete the .txt file.
Your Help/Suggestion will be appreciated.
Thanks,
Chandra Shekhar Agihotri
02-11-2016 10:45 AM
Hi.
Please give some details on error thrown by your application.
Hope to help
Bye
02-11-2016 11:34 AM
Hi Roberto,
Program is creating the file 1 txt file on local machine then open that file in edit mode and select all the data and try to create the table.
When try to create the table, program getting the Communication error.
(CALL METHOD OF wordobj 'TextToTable'')
Below is the program code for better understanding
Regards,
Chandra Shekhar Agnihotri
02-11-2016 12:04 PM
Hi..
Well you get sy-subrc 1 from Method TextToTable.
It seems that method "Open" of documents with ReadOnly it's OK, and EditSelectAll method too.
I suggest you to put a code to paste value of txt in document and close it and then try to use TextToTable method.
Hope To help
Bye
02-11-2016 12:13 PM
Hi Roberto,
The same code was working fine with Microsoft 2010 and Program start throwing error after upgrading the Microsoft Office from 2010 to 2016. and same program is still working fine on machines having Microsoft 2010
You mean to say I have to change the code of each and every program where the program throwing error due to office upgrade.....Is this the right solution..?
Regards,
Chandra Shekhar
02-11-2016 12:21 PM
Unless I'm completely mistaken, Microsoft Office 2016 is only supported as of patch level 5 of SAP GUI for Windows 7.40 (you can find the relevant SAP notes in the link I posted earlier)
02-11-2016 12:24 PM
Hi Nierop,
I have SAP GUI 7.40 patch level 7. So I don't think that GUI is the issue.
Regards,
Chandra Shekhar Agnihotri
02-11-2016 1:38 PM
No.
You say 2013 is ok and that sounds good but if not I read something about a problem with TextToTable method with 2013 that is not supported.
Note 1888226.
Solution can be a workaround of method "TextToTable" using a Macro for the *.doc word file.
02-11-2016 1:48 PM
Hi Reberto,
you are right. The old Microsoft office was 2010.
Can you please suggest the workaround for "TextToTable " method.
Regards,
Chandra Shekhar
02-11-2016 5:24 PM
Hi.
Sorry for delay.
You should create a Doc model in word with a macro saved behind (calling that such "TextToTab". This macro will reply your steps ...select all text inside and click on Table=> Convert textTotable function)
Then once you open your TXT, copy that content into this model DOC and then run macro from this doc model
CALL METHOD OF wordobj 'RUN'
EXPORTING
#1 = 'TextToTab'.
This macro would be better if you know something of VB. It could receive also the text you want to convert .
This should work.
Bye
02-12-2016 11:38 AM
Thanks Roberto,
I did corrections suggested in note 1888226 and it works.
Regards,
Chandra Shekhar
02-11-2016 12:02 PM