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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

DDE Kepware to Excel KEPServerEX

ScottInTexas
12-Amethyst

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.

 

ACCEPTED SOLUTION

Accepted Solutions

I have done nothing different than what has been outlined in this thread. I restarted the service, made sure all the settings were set. I had Kepware and Quick client running. I opened the Excel spreadsheet and everything was working and updating. When it opened it asked if I wanted to reconnect to external data and I responded 'Yes.' I saved the file, closed the file and reopened the file. It is still working. 

 

So the answer to my question is "keep beating on it until it works right."

 

Thanks to everyone that responded here and especially the techs at PTC who spent time on the phone with me. It is comforting to know that I am spending my company's money on a good company.

 

Scott

View solution in original post

11 REPLIES 11

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

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
15-Moonstone
(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

Any chance Windows Defender is running?  I'm wondering if that might be affecting it.  Also, make sure UAC is disabled/set to its lowest level.  I would also check both of those settings are still disabled after a reboot.  It's possible that there is a domain policy  or group policy that is turning them back on when the system is restarted.

 

-Andy

Windows Defender is running. I was able to lower the UAC to the lowest setting. That made no difference. I don't know what to do about Defender because that is controlled by the cyber security people. I have a call out to them already. We'll see what happens.

 

 

I have done nothing different than what has been outlined in this thread. I restarted the service, made sure all the settings were set. I had Kepware and Quick client running. I opened the Excel spreadsheet and everything was working and updating. When it opened it asked if I wanted to reconnect to external data and I responded 'Yes.' I saved the file, closed the file and reopened the file. It is still working. 

 

So the answer to my question is "keep beating on it until it works right."

 

Thanks to everyone that responded here and especially the techs at PTC who spent time on the phone with me. It is comforting to know that I am spending my company's money on a good company.

 

Scott

Announcements


Top Tags