Sign in to follow this  
Followers 0
mulderm

DDE in Excel give type mismatch (13)

4 posts in this topic

Hello, In Excel I have the follow VBA-code: Const bit8 as integer = 256 dim channelnum as long dim woord1 as integer, hulpwoord1 as integer channelnum=DDEInitiate("RSLINX", "Topic") woord1=DDERequest(channelnum, "N7:0") hulpwoord1=woord1 / bit8 'giving type mismatch DDETerminate channelnum Problem: When I get the value of N7:0 (13112) I get a type mismatch error nr:13 in my code by the row hulpwoord1. Who knows the problem? I want to convert the Integer N7:0 to 2 ascii karakters. For N7:0=13112 LSD=8 and MSD=3 mulderm

Share this post


Link to post
Share on other sites
Try the following code.. Woord1 is converted to the first word in an Array causing the Type Mismatch, using woord1(1) and declaring it as a variant should fix the problem.. Const bit8 As Integer = 256 Dim channelnum As Long Dim woord1() As Variant, hulpwoord1 As Integer channelnum = DDEInitiate("RSLINX", "Topic") woord1 = DDERequest(channelnum, "N7:40") hulpwoord1 = woord1(1) / bit8 'giving type mismatch DDETerminate channelnum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0