cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

DDE Kepware to Excel KEPServerEX

ScottInTexas
6-Contributor

DDE Kepware to Excel KEPServerEX

Hi All,

I am trying to use DDE to get the data from Kepware to an Excel spread sheet. This was working for a day or two then quit. I have had help from a super nice couple of people at PTC. Alin in Romania and Brent in Maine. But we are not able to get the data and there is no apparent reason for it. The Excel file has formulas in the cell that look like this '=kepdde|_ddedata!OmronNJ.MespackHFFS.ReaTop2Temperature.' When first typed into a new spreadsheet, it was populated with the current temperature. For a while it even updated with each change of the temperature. As well as all the other tags written into the spreadsheet. Then I saved the spreadsheet. I opened it Monday and there was nothing but #REF in all the cells. Starting from a blank spreadsheet, I typed in the same formulas and got the current values. But they would not update. I could see the temperature changing in the Quick Client, but the spreadsheet was not changing. I opened a new spreadsheet and typed the formula in a cell and got the same value as the other spreadsheet which was not the current value. 

The has to be some setting in Excel that I am missing. 

Macro Security: Enable VBA Macros (not recommended; potentially dangerous code can run). Selected.

Trust access to VBA project object model. Checked

The folder where the file exists is in the Trusted Locations.

Workbook Calculation: Automatic (Calculate Now did not have any effect).

In KEPServer

Enable DDE Connections to the server - Yes

Service name - kepdde

Advanced DDE - Enable

XL Table - Enable

CF_TEXT - Enable

Channel Name OmronNJ

Device Name - MespackHFFS

Setting - Runtime Process - Interactive

 

The runtime has been stopped and restarted (reinitialized) a number of times. It has also been disconnected and when the dialog box comes up to reconnect it has reconnected.

 

That's it. If anyone has any idea that does not include API calls (that's a separate topic) I would appreciate the input.

 

Thanks.

 

8 REPLIES 8

Did you add the installation location for the Kepware 'server_runtime.exe' to the trusted locations tab in the Security Center for Excel?

 

-Andy

Yes. That is also set.

I just set mine to read from the Simdemo project.  I will let it run for a few hours to see if it times out unexpectedly or does not retain updates after closing and opening.

 

aservetas_0-1727350678144.png

 

-Andy

Andy Servetas
Principal Technical Support Engineer | Kepware Technologies

 

Greetings,

Does this Post answers your question.  For the benefit of other Community Members who may have the same question, it would be great if you could designate it as the Accepted Solution.

In the event that this response did not answer your question, please post your current status so that we can continue to support.

Thanks for using the PTC Community!

Regards,
Mohit

ScottInTexas
6-Contributor
(To:MRohilla)

Let's see what Andy discovers.

 

When I closed and re-opened the workbook, I saw this:

 

aservetas_0-1727372055908.png

Upon opening the trust center, I can see this setting:

aservetas_1-1727372435234.png

I enabled this and it seems to work after the next close/re-open.

 

-Andy

 

aservetas
13-Aquamarine
(To:aservetas)

I did notice that I have to open Excel first with right-click > run as Administrator elevation, then File > Open > (workbook) and accept the prompt to update external links for the tag updates to resume as expected.

 

-Andy

Thank you, aservetas,

 

First, I have Excel set to always run as Administrator. I get that prompt about external links. If I click OK, then I get the message shown in the second image below. The one about corrupted or missing programs. It thinks kepdde is an executable. As you can see in the third image, I already have settings for DDE set.

 

This is mind blowing. DDE is a simple, still supported, protocol. 

 

Scott

Announcements

Top Tags