INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

(OP)
Hi guys,

i have a problem when trying to merge a word to excel (Office 365) through powerbuilder 12.5 application.

The below code is working fine in earlier versions of Office... But not in Office 365 Proplus..

Have a look, and if someone have a suggestion please dont hesitate,, any reply would be really appreciated!!

The code for the Microsoft Office transactions...

if ll_systemPrintouts = iuo_tools.MS_OFFICE then

oleobject iole_word
long ll_Error
iole_word = CREATE oleobject
ll_Error = iole_word.ConnectToNewobject("word.application")

CHOOSE CASE ll_Error
CASE -1, -2, -3, -4, -9, -15, -16
word_exception luo_exception
luo_exception.setmessage ( "The application cannot connects with Word" )
luo_exception.setexplain ( "Code Error: " + String ( ll_Error ) )
Throw luo_exception
END CHOOSE

iole_word.Documents.Open( ls_path )

iole_word.ActiveDocument.MailMerge.MainDocumentType = 0
iole_word.ActiveDocument.MailMerge.OpenDataSource( ls_DataSourceFile,0,false,false,false,false,"","",false, &
"", "", "Entire Spreadsheet", "SELECT * FROM 'Sheet1$'", "", false, 8)
iole_word.ActiveDocument.MailMerge.Destination = 0
iole_word.Application.Visible = abl_visible

return iole_word

else
.....
Bear in mind that the applications crashes on , ActiveDocument.MailMerge.OpenDataSource

Please guys i m so stack in this point and dont know what to do :( any help would be really appreciated

Thank you in advance

RE: Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

Check office documentation on the opendatasource method to make sure it is still valid.

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

(OP)
Thank you Matt for the reply ,

the only documentation for this method that i can find on the net is for office 2003 and is the following passing 16 parameters like my code.. with the following description,

.........................
This documentation is archived and is not being maintained.
OpenDataSource Method

Office 2003
Attaches a data source to the specified document, which becomes a main document if it's not one already.
expression.OpenDataSource(Name, Format, ConfirmConversions, ReadOnly, LinkToSource, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Connection, SQLStatement, SQLStatement1, OpenExclusive, SubType)
expression Required. An expression that returns a MailMerge object.
Name Required String. The data source file name. You can specify a Microsoft Query (.qry) file instead of specifying a data source, a connection string, and a query string.

https://msdn.microsoft.com/en-us/library/aa220319(...
.............................

cant find for office 365... :(

RE: Problem when merging word and excel Office 365 Proplus from powerbuilder 12.5 application

As it is not in the code sample you provided but is the value in ls_DataSourceFile valid (correct path and filename)?

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close