I am trying to programme in Visual Studio 2008. I am trying to change vensim Constant variable value using trackbar control in Visual Studio 2008.
I have assigned the maximum, minimum and the tick frequency to the trackbar control. When i run the code and use the trackbar control, the values change corresponding to the the position of the trackbar. This means that the trackbar is working.
The bproblem is how to assign the trackbar value to the vensim constant variable so that when i run the simulation, the vensim contant varible's value will be that ot the value generated by the trackbar control.
Below is the code in Visual studio that am working with
Dim result As Object
Dim result1 As Object
Dim value As Integer
TrackBar1.Maximum = 6
TrackBar1.Minimum = 0
TrackBar1.TickFrequency = 1
TextBox1.Text = TrackBar1.Value
value = TrackBar1.Value
result = vensim_command("SIMULATE>SETVAL|Initial rate of capacity utilization=TrackBar1.Value")
result1 = vensim_command("SIMULATE>GETCNSTCHG|Initial rate of capacity utilization")
Can some one help me with this code?

Thanks