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: 6
Default Glolbal Variables Reset when using OleObjects

I am having where my global variables are being reset when a
subroutine processes/creates OleObject checkboxes. The check boxes
are on the worksheet and are used to turn on and off data points.

I also have a chart where I use with mouse events to select datapoint
off the graph. I have defined an EventsClassModule (since I create
the chart on the fly) and I initialize it and it works fine until
another routine is excecuted where I process data, add checkboxes
(OleObject) and create new charts.

If I comment out the call to the addCheckBox routine, the golbal
variables and the eventsClassModule work fine.

Any suggestions on how to get around this problem?

Thanks in advance for the help.

Rock


Here is the routine to create the checkboxes:

Private Sub addCheckBox(rw As Long, cl As Long)
Dim myRng As Range, myCell As Range, myObj As Object

With adjSH
Set myRng = .Cells(rw, cl)
For Each myCell In myRng.Cells
Set myObj = ActiveSheet.CheckBox.Add
'Left:=myCell.Left + 0.5 * myCell.Width - 0.5
* myCell.Height, _
'Top:=myCell.Top, Width:=myCell.Height,
Height:=myCell.Height)
myObj.Name = "chkbox" & myCell.Row
myObj.Object.Value = True
myObj.Object.Caption = ""
myObj.Object.GroupName = "checkboxes"
myObj.Placement = xlFreeFloating
Next myCell
End With
Set myObj = Nothing

End Sub
 
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
Tab Key reset DKSteph Excel Worksheet Functions 2 March 20th 09 07:20 PM
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
Assigning click event to OleObjects checkbox Jim McLeod Excel Programming 5 April 20th 04 07:02 PM
Referring to OLEObjects (combobox's on worksheet) Ian Chappel[_2_] Excel Programming 4 September 22nd 03 05:31 PM


All times are GMT +1. The time now is 07:03 PM.

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"