Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Question to a VBA Wizard!?

Hi,

I have below a piece of VBA code. Everytime the whole code is run, one
Excel worksheet named "Constraint" is frozen before "Model.Solve" is
called and de-frozen after that within the "JobNr" loop; using
".EnableCalculation".

The worksheet, "Constraint", has one cell with RAND() in it.


The problem I am getting is described next to the "For JobNr" row
loop:


Dim JobNr As Integer
For JobNr = a To a 'I mean here 1 To 1, 3 To 3,....once at a time
'it works fine
1 To 5 'However, it keeps repeating same reults each
time as
'if EnableCalculation is NOT working!

Range("B7").Value = JobNr

Workbooks(filename).Worksheets("Constraint").Enabl eCalculation = False
vehicleModel.Solve

line = 1

For Each mac In vehicleModel.Macros
rngSolution(JobNr, line).Value = mac.Value
line = line + 1
Next mac
Workbooks(filename).Worksheets("Constraint").Enabl eCalculation = True
Next JobNr


What should I do to fix this?

Thanks,
Mike
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
Template Wizard & Database question Silena K-K Excel Discussion (Misc queries) 0 March 26th 08 09:23 AM
Chart Wizard Steven Excel Discussion (Misc queries) 1 January 4th 08 06:03 PM
Allow the use of the fx wizard within the fx wizard for nesting Ron Excel Worksheet Functions 1 October 2nd 05 08:58 PM
Question about Query Wizard Anita Excel Discussion (Misc queries) 0 March 7th 05 03:51 PM
Wizard RTP Excel Discussion (Misc queries) 3 December 29th 04 11:11 PM


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