LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Two problems with Application.Run "ATPVBAEN.XLA!Random"

This is in Excel 2002 - with Visual Basic 6.3.

I have two problems with a macro than uses this function. Neither are
killers, but both are annoying. I have seen similar problems
referenced in this group over the years, but never really saw an
answer (usually somebody had a different way of achieving the desired
outcome rather than a straight fix).

The first problem I have a workaround for but would really appreciate
some explanation as to what is going on.

Basically I have a macro to allow a "Monte Carlo" type simulation, but
also allow the same set of random numbers to be recreated for test
etc. The key line is:
Application.Run "ATPVBAEN.XLA!Random",
ActiveSheet.Range("RandomBlock"), 3, 41, 1, intSeed, 0, 1

(intSeed is a number that changes in a regular way through the
iterations.)

I can get this to run. But if i break the macro early (mainly due to
the second problem) and then try to run it again, i get the error:
The macro '' cannot be found.

This error also happens at other times for no reason I can understand
(for example, I recorded the macro to get the structure of the
equation and it worked fine either running with a macro button or
straight from the code - but then I changed the seed value from '1' to
'intSeed' and it began giving the error noted, so I changed it back to
'1' but the error kept happening until I tried the thing below).

The workaround is to now uncheck the add-in for "Analysis Tool-Pak
VBA" (and excel then says it can't to that because it is in use, but
seems to anyway) and then recheck it again. The macro now runs fine -
until I do something random and it all falls apart again.

The obvious question is "why?".

The second problem is that I don't really want to see all the
iterations happening (just the averaged results of the x simulations I
run). So I have an Application.ScreenUpdating = False line in the
macro. But the screen still updates every time that the
Application.Run line is hit. Is there any way to stop this happening?

Thanks in advance.

James

 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
"WinForm Application" to act as "RTD Server" using .Net mduraidi Excel Discussion (Misc queries) 0 March 30th 06 01:01 PM
"WinForm Application" to act as "RTD Server" using .Net mduraidi Excel Programming 0 March 30th 06 12:55 PM
"ATPVBAEN.XLA!Random... output M_Nadel Excel Programming 1 March 7th 05 10:51 PM


All times are GMT +1. The time now is 03:12 AM.

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

About Us

"It's about Microsoft Excel"