Solved

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

Posted on 2002-07-04
9
366 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:anilsharma
9 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 7129714
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.
0
 

Author Comment

by:anilsharma
ID: 7133411
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
0
 

Author Comment

by:anilsharma
ID: 7133514
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
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7133992
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).
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:anilsharma
ID: 7139556
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.
 
0
 

Author Comment

by:anilsharma
ID: 7145149
Please have some comments.
or suggest some books from which I may get this solution for the question.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7990619
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
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8050698
Question placed in PAQ

Computer101
E-E Admin
0
 

Expert Comment

by:ipesin
ID: 9692244
can you provide answe to this question?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now