Solved

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

Posted on 2002-07-04
9
391 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 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