Skip to main content
12-Amethyst
September 19, 2024
Solved

DDE Kepware to Excel KEPServerEX

  • September 19, 2024
  • 3 replies
  • 6705 views

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.

 

Best answer by ScottInTexas

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

3 replies

15-Moonstone
September 24, 2024

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

 

-Andy

12-Amethyst
September 24, 2024

Yes. That is also set.

15-Moonstone
September 26, 2024

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

 

12-Amethyst
September 25, 2024

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

12-Amethyst
September 26, 2024

Let's see what Andy discovers.

 

15-Moonstone
September 26, 2024

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

 

ScottInTexas12-AmethystAuthorAnswer
12-Amethyst
October 3, 2024

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

12-Amethyst
March 4, 2025

This is the final word! The problem was simply that Excel must be started in Administrator mode. I had (or thought I had) set Excel to always run in administrator mode, so I did not keep checking that. All I have to do is start Excel as an administrator then open the DDE file. Brent was super helpful and he was able to help without busting out laughing or calling me an idiot out loud! Which I appreciated. Thanks to everyone for your input, Again, thanks to Brent!