Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Timer causes run-time error '6' overflow

I'm using Timer to profile some code. For no reason I can think of
I'm getting overflow when trying to call Timer to get the time value.

Why would this happen?
If I enter debug mode and press continue, the error goes away.

Thanks,

Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Timer causes run-time error '6' overflow

Brian,

Post your code?

Bernie
MS Excel MVP

"Brian Murphy" wrote in message
...
I'm using Timer to profile some code. For no reason I can think of
I'm getting overflow when trying to call Timer to get the time value.

Why would this happen?
If I enter debug mode and press continue, the error goes away.

Thanks,

Brian


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Timer causes run-time error '6' overflow

It's a really long bit of code.
I've used Timer quite often to profile code. I've never had this
problem before.
The way I generally use it is like this:

Dim startTime as Double
startTime = Timer

.... code being timed goes here ...

Debug.Print (Timer - startTime)

The overflow happens on the second call to Timer. I tried all
different manners of data types and such, with no luck. If I enter
debug mode and press F5, the code continues running with no problem
until it comes back to this same line again.

It just doesn't make any sense.

After some more work on this I think I've got a clue.
I found that if I move the .Print line up far enough it will run.
The error starts right after a VBA call to a routine in compiled DLL
(it's in Fortran).
The error will stop happening if the Timer call is after a line that
puts data in a cell on a worksheet.

Somehow the call to the DLL seems to lock up the Timer, but putting
data onto a worksheet unlocks it.

Could this be possible?

Brian





On Dec 11, 10:03*pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Brian,

Post your code?

Bernie
MS Excel MVP

"Brian Murphy" wrote in message

...

I'm using Timer to profile some code. *For no reason I can think of
I'm getting overflow when trying to call Timer to get the time value.


Why would this happen?
If I enter debug mode and press continue, the error goes away.


Thanks,


Brian


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
Overflow error Barb Reinhardt Excel Programming 3 April 16th 09 09:35 PM
run-time error '6' - overflow - once I declare a pre-used variable name as integer ker_01 Excel Programming 4 September 2nd 08 02:24 PM
run-time error 6 - overflow Paul Excel Programming 1 November 11th 04 11:09 AM
Run-time error '6' overflow Suzy[_2_] Excel Programming 2 February 13th 04 04:55 PM
Run-time error 6 Overflow FredM Excel Programming 2 January 20th 04 06:05 AM


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