Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Problem with Macro

Dim TotTemp As Double

Private Sub PSTimer1_Tick()
Chan = Application.DDEInitiate("WinWedge", "COM2")
mydata = Application.DDERequest(Chan, "FIELD(3)")
TotTemp = TotTemp + mydata
ctr = ctr + 1
End Sub


I am getting "Type Mismatch" error at TotTemp = TotTemp + mydata .

Any ideas ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Problem with Macro

See what value mydata has. It probably is not a double, possibly an error
or a string.

--
Jim Rech
Excel MVP
"Shashi Bhosale" wrote in message
...
| Dim TotTemp As Double
|
| Private Sub PSTimer1_Tick()
| Chan = Application.DDEInitiate("WinWedge", "COM2")
| mydata = Application.DDERequest(Chan, "FIELD(3)")
| TotTemp = TotTemp + mydata
| ctr = ctr + 1
| End Sub
|
|
| I am getting "Type Mismatch" error at TotTemp = TotTemp + mydata .
|
| Any ideas ?
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with Macro

Is mydata a string?

Maybe try

TotTemp = TotTemp + CDbl(mydata)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Shashi Bhosale" wrote in message
...
Dim TotTemp As Double

Private Sub PSTimer1_Tick()
Chan = Application.DDEInitiate("WinWedge", "COM2")
mydata = Application.DDERequest(Chan, "FIELD(3)")
TotTemp = TotTemp + mydata
ctr = ctr + 1
End Sub


I am getting "Type Mismatch" error at TotTemp = TotTemp + mydata .

Any ideas ?




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
Macro problem help please. Nevyn New Users to Excel 3 October 19th 09 02:11 AM
Problem with macro Dazed and Confused[_2_] New Users to Excel 2 March 7th 09 11:48 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro problem Pete Provencher Excel Programming 3 June 7th 04 08:58 PM


All times are GMT +1. The time now is 05:07 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"