Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Use DDE in VBA code.

I have a ray-trace application which is supposed to support DDE. If I type something lik

=ZEMAX|ignored!"GetSurface,2"

into a cell it returns a string from the ZEMAX application which contains information on surface 2.

STANDARD,-9.070294785E-005,-3.969000000E+003,MIRROR,1.751943691E+003,-1.000000000E+000,0.000000000E+000,0.000000000E+000 ,0.000000000E+000,0.000000000E+000,0.000000000E+00 0,0.000000000E+000,0.000000000E+000,0.000000000E+0 00

It also changes the formula displayed in the editing window to something lik

='#19264'|'#23'!'GetSurface,2'

(the values change every time, and the link doesn't work next time the application is started)

This isn't very helpful, so I tried writing a VBA function to set the cell up. That doesn't work (apparently you can't change cell values from within a function)

Is there a way to execute a given string as if it was typed into a cell and return the results to a variable in VBA

I have also tried the DDE functions directly within a macro, but I couldn't get them to work.

Any help much appreciated

Chri


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM
VBA code delete code but ask for password and unlock VBA protection WashoeJeff Excel Programming 0 January 27th 04 07:07 AM


All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"