Link to home
Start Free TrialLog in
Avatar of anilsharma
anilsharma

asked on

How to use DDE PACKAGE of developer 2k with EXCEL (specially DDE.EXECUTE

Please tell me how to use DDE.execute to format the
excel (97 or 2000)  worksheet from Developer 2000.

to use the dde.execute the syntax is
DDE.EXECUTE(channel_id,'[cmdstring]',timeout);

what are the different cmdstring here .
send some detail or source from where I may able to get the details.


Anil
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

DDE is not necessarily the best method for manipulating Office applications such as excel. It is far simpler to use the Excel Object library and use OLE automation to deal with these applications.

Add a reference in your project to Microsoft Excel Object Library 8.0 ( or 9.0 for 2000) and you can then use the excel object model directly in VB:

Dim appExcel As Excel.Application
Dim wbkMyBook As Excel.Workbook
Dim shtMySheet As Excel.Sheet
On Error Resume Next
'Get an existing excel instance
Set appExcel = GetObject(,"Excel.Application")
If Err.Number <> 0 Then ' There is no instance
  Set appExcel = CreateObject("Excel.Application")
End If
On Error Goto 0
With appExcel
  Set wbkMyBook = .Workbooks.Open ("c:\MyFolder\MyWorkbook.xls")
  .Visible = True 'Default is not visible
End With
Set shtMySheet = wbkMyBook.Sheets("Sheet 1")
With shtMySheet
  .Cells(1,1) = "Hello"
  .Cells(2,2) = "Again"
End With
wbkMyBook.Save
appExcel.Quit
Set shtExcel = Nothing
Set wbkMyBook = Nothing
Set appExcel = Nothing

You can use any of the standard excel objects and functions using this method, if for example you record a macro in excel that does what you want you can then copy this code to VB and as long as you include the appropriate object first it will do exactly the same as the macro code in excel.
Avatar of anilsharma
anilsharma

ASKER

I am not much aware of VB. But know little about VB.
Where I have to put this code ? In developer 2k form or report Or Excel Application.

The code which u have given is purly VB or Excel application code . Is this code is supported by Developer 2k .If yes how ?
If u have some D2k code. aboubt DDE Please send it to me by E-mail anilsharma64@epatra.com

Thanks for quick reply.
Waiting again for ur reply.

Anil
I am not much aware of VB. But know little about VB.
Where I have to put this code ? In developer 2k form or report Or Excel Application.

The code which u have given is purly VB or Excel application code . Is this code is supported by Developer 2k .If yes how ?
If u have some D2k code. aboubt DDE Please send it to me by E-mail anilsharma64@epatra.com

Thanks for quick reply.
Waiting again for ur reply.

Anil
Anil, this forum is about sharing information and solutions to problems, as such even if I had any information to send it would be inappropriate to do so. The code sample I show is purely written in VB but manipulates the OLE automation objects of Excel. I must admit to some confusion when you keep mentioning "Developer 2K" what does this represent?

Please explain more clearly what you are actually trying to achieve and the applications/languages you are using (or trying to use).
Developer 2000 contain Form 6.0 ,Report 3.0 and Graph 3.0. Basiclly it is Oracle product used as front end tool to develop the application.
It has own package to deal with OLE object like
OLE2.CREATE_OBJECT,
OLE2.Add_Arg
OLE2.Create_Arglist
OLE2.Destroy_Arglist
OLE2.Get_Char_Property
OLE2.Get_Num_Property
OLE2.Get_Obj_Property
OLE2.Invoke
OLE2.Invoke_Num
OLE2.Invoke_Char
OLE2.Invoke_Obj
OLE2.IsSupported
OLE2.List_Type

OLE2.Obj_Type
OLE2.OLE_Not_Supported
OLE2.Release_Obj
OLE2.Set_Property
These package are used to link the MS application.
There is no adequate help given how to use these package.

Basically I want to fetch the data from Oracle 8 table and mainplaute in Developer Forms 6.0 and then the data has to put into the excel worksheet.After putting the data I want to Save the excel worksheet,print out and so on.
 
Please have some comments.
or suggest some books from which I may get this solution for the question.
Avatar of DanRollins
Hi anilsharma,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

anilsharma, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can you provide answe to this question?