News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Excel & DDE

Started by jj2007, January 01, 2020, 04:46:17 PM

Previous topic - Next topic

jj2007

Hi folks,

I am refining the MS Excel DDE interface and would like to know if it's working with other versions of Excel. Can you give me some feedback please? Extract the exe to a folder that contains *.xls files, select some cells and click RichLink or PoorLink. No changes will be made to the *.xls file unless you click the Write button.

Source is also included, but it won't build properly for the time being - this is work in progress :cool:

Biterider

Hi JJ
The application works without crashing. It reflects changes using rich- and poorlink.
Unfortunately, the write process fails somehow and displays a dialog box with the message
Quote"### Write R9C2 NOTPROCESSED ###"
It seems that the program doesn't recognize .xlsx files.

Biterider


jj2007

Interesting, thanks. Which Excel version is that? If you load an xls file: same behaviour?

Biterider

Hi JJ
It is Excel version 2013 (15.0.5179.1000  32 bit).
The described write problem is using an xls file. If you have an xlsx file, it pops up a a warning message, that no excel file is found in this directory.


Biterider

jj2007

#4
Ah, ok - that's a minor problem because I just let it search for *.xls files (corrected in the attached version). It works fine with *.xlsx, too.

The message instead signals some kind of write protection, e.g. when using the (read-only) Excel viewer, see below. Is your file write-protected, or is the macro security set to a high level?



It works fine here on Win7-64 with Excel 2003, Excel Starter 2010 and the Excel viewer (no writing for the latter, of course).
Attached a new version, plus one xlsx file for testing.

Some consider DDE obsolete, but recently Microsoft seems to support it again, at least with Excel and Access. I wonder if the functionality of this proggie can be achieved with COM, too  :cool:

DDE Function
QuoteAccess for Office 365 Access 2019 Access 2016 Access 2013 Access 2010 Access 2007

This from May 2018, About Dynamic Data Exchange:
QuoteUses for Windows Dynamic Data Exchange
DDE is most appropriate for data exchanges that do not require ongoing user interaction. Usually, an application provides a method for the user to establish the link between the applications exchanging data. Once that link is established, however, the applications exchange data without further user involvement.

DDE can be used to implement a broad range of application features — for example:

Linking to real-time data, such as to stock market updates, scientific instruments, or process control.
Creating compound documents, such as a word processing document that includes a chart produced by a graphics application. Using DDE, the chart will change when the source data is changed, while the rest of the document remains the same.
Performing data queries between applications, such as a spreadsheet querying a database for accounts past due.

Biterider

Hi JJ
The .xlsx problem still remains here. It starts to work if I copy an xls file into the directory.
Biterider


jj2007

Quote from: Biterider on January 02, 2020, 04:52:02 AM
The .xlsx problem still remains here.

Yep, wrong version - sorry! But can you write now to the file?

LiaoMi

Quote from: jj2007 on January 02, 2020, 07:12:07 AM
Quote from: Biterider on January 02, 2020, 04:52:02 AM
The .xlsx problem still remains here.

Yep, wrong version - sorry! But can you write now to the file?

Hi jj2007,

Office 2019, the program starts, but that's all ..

---------------------------
xls:
---------------------------
### Command [app.activate()]: NOTPROCESSED ###
---------------------------
OK   Cancel   
---------------------------

jj2007

Thanks, LiaoMi :thup:

xlsCommand "[app.activate()]" doesn't do much, and there is no particular reason why it should choke. But it seems that DDE is working in principle, because xlsConnect worked.

I found several sites (e.g. here and here) suggesting this:
QuoteClick the Office (2007) button.

Click Excel Options.

Click Advanced.

Scroll down to the General section.

Make sure that the check box "Ignore other applications that use Dynamic Data Exchange (DDE)" is clear (not ticked).

Click OK.

Apparently this is also the official Microsoft solution :cool:

Biterider

Hi JJ
Version 3 works now with .xlsx files.
Writing is still a problem. I deactivated all security options in the Trust Center but still no success.

Biterider

jj2007

Quote from: Biterider on January 02, 2020, 07:07:55 PMWriting is still a problem. I deactivated all security options in the Trust Center but still no success.

Thanks for testing this, Biterider. DDE has always been messy and badly documented, but if it runs, it is very powerful. Apparently Microsoft got pressure from Bloomberg and others to reactivate it in the new Office versions :tongue:

LiaoMi

Excel "write" doesn't work for me, no matter how I try, everything else works fine  :thup:

https://docs.microsoft.com/en-us/windows/win32/api/_dataxchg/

jj2007

Thanks for testing this. I just launched my Win10 machine, it has Excel 2003 installed but when I open an .xls or .xlsx the Windows installer is showing up telling me it must configure the free Excel viewer. Every time it does that, mysteries of M$ :cool:
And it fails partly with strange messages, but I can see the rich text table after a while... the usual Micros**t mess :sad:


jj2007

Quote from: LiaoMi on January 11, 2020, 05:48:25 AM
Where can I download DDESpy?

Thanks a lot, LiaoMi - DDESpy helped me to discover a weird little bug: for a DdeClientTransaction, I had passed a string handle instead of a string pointer. It still worked, strangely enough, but DDESpy reported a problem.

I am not sure, though, whether that fixed the Write button problem for you. Here it works fine with Win7-64, Win10 Home and my XP VM.

Grateful for a test :thup: