myoleobject = CREATE oleobject
rc = myoleobject.ConnectToNewObject ("Excel.Application")
If rc <> 0 Then
MessageBox ( "Error", String ( rc ) )
Return
End If
myoleobject.Application.Visible = TRUE
Here I would like to open a particular file, does anybody knows what is the
command?
Regards,
CCH
On 27 Dec 2008 18:34:29 -0800, "cch" <ccha...@arazozabrothers.com>
wrote:
-----------------------------------
My Web 2.0 Stuff
Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong
The easiest way to find this information is to record a macro as you
perform a file open. You will of course want to eventually do more
than just open the file. But since you asked:
myoleobject.Workbooks.Open ("<filename with path>")
Also, please be aware that there currently is no support for Office
2007 in any vesion of Powerbuilder. And I had better correct some
terminology misunderstanding of the controls before you get too deep.
The code above does NOT use an OLEControl. You are using an OLEObject.
There is a big difference in them. Here are some:
1. Office 2007 does NOT work with an OLEControl but does with
OLEObjects.
2. OLEControls allow inplace editing but an oleoject does not.
3. OLEControls use file extensions to figure out the ole application
to open. This is the crux of the problem with Office 2007.
Powerbuilder has no knowledge of the new filetypes.
So if you just want to perform remote control of Excel,then OLEObjects
are the best way to go. Lastly, please read the online help. The have
ome usefull information there alo.
Wheeley
P.S.
OLEOjects work fine with Excel 2007. So if you need Office 2007
support, you must use them.
"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:kf4fl4l613k57840c...@4ax.com...