Calling DDE from Excel 2010 crashing on Win 8.1 VM

Trying to use DDE to connect Excel to an external application (Vensim DSS) on a windows 8.1 virtual machine (VM) which seems to hang Excel (specifically when you call DDEInitiate). I have no problems with the same VBA script (code reproduced below if needed) on a standard PC with windows 8.1 and Vensim DSS. Also a previous incarnation with windows 7 VM and Vensim worked with no problem. Does anybody have ideas what is different on a win 8.1 VM or some process that I need to ensure is running on the VM for DDE to work?

I have tried with Excel 2003, Excel 2007 and Excel 2010 and all experience the same issue of hanging when calling the DDEInitiate function. 

Many thanks in advance,
Dave

Option Explicit
Dim DDE_channel As Integer

Function StartupDDE() As Boolean
          
    Dim blnIsRunning As Boolean
          
    On Error GoTo Err_Handler
    blnIsRunning = VensimRunningCheck
        
    'Check to see if Channel Number has already been assigned
    If Not DDE_channel > 0 Or blnIsRunning = False Then
    
        'Channel not assigned - check to see if Vensim running
        If blnIsRunning = False Then
            
            'Vensim not running - try to open
            Dim RetVal
            RetVal = Shell("C:\Program Files (x86)\Vensim\Vensim.exe", vbMaximizedFocus)
            AppActivate "Microsoft Excel"
            Excel.Application.Visible = True
            
        End If
        
        'Connect to Vensim
        DDE_channel = Application.DDEInitiate("VENSIM", "System")
    End If
        
    StartupDDE = True
    Exit Function
    
    
Err_Handler:
    MsgBox "There was an error trying to connect to Vensim.  Please close and reopen Vensim manually", vbExclamation + vbOKOnly, "Vensim Connect Error"
    StartupDDE = False
           
End Function

February 3rd, 2015 10:37am

Hi,

As far as I know, the DDE is a very old technology, I recommend we try to use the Access object model instead of DDE.

http://msdn.microsoft.com/en-us/library/office/ff192120(v=office.15).aspx

If you have any further question about debugging code, I recommend you post the question to the MSDN forum for Excel

http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

George Zhao
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
February 4th, 2015 1:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics