OLEobject VBA
Jul 25, 2008
I have a VBA question. So I have a radio command control in my excel spreadsheet that is linked to a particular cell. What VBA code would I enter into that control that would make the control visible = false based on whether or not the cell to the right of linked cell meets a certain criteria (= 1 for example.)
View 9 Replies
Jun 6, 2007
I'm developing a series of schedules that organize building plans. In one schedule I maintain a list of areas (called spaces, like a lobby or a conference room). I programatically maintain the list of spaces in the schedule for sorting and other external functions that are irrelevant. In the process I occasionally delete a worksheet. My worksheets have 4 buttons and a combobox. Whenever I delete a worksheet with these objects, I lose ALL of my module-level variables. These include two collections, a boolean, and an integer.
I'll post only the code for now. If you want to replicate, remember to place at least one button or combobox on your worksheet. You'll need to execute each sub manually. I have placed debug statements to print the globals to the immediate window. Notice that the 3rd debug statement shows the globals as present when it's called from the delete routine; however, if you manually execute that print routine after the delete, the globals are gone!
Option Explicit
Const SHEET_TARGET_RANGE As String = "C13:K36"
Dim m_objLocal As New Collection
Dim m_objMaster As New Collection
Dim m_bln As Boolean
Dim m_int As Integer
Public Sub Debug_Populate_Globals()
Dim intLoopCounter As Integer
Set m_objLocal = New Collection
Set m_objMaster = New Collection
For intLoopCounter = 1 To 8
m_objLocal.Add intLoopCounter, CStr(intLoopCounter)
m_objMaster.Add intLoopCounter, CStr(intLoopCounter)....................
View 6 Replies
View Related
May 23, 2009
I've searched the web and OzGrid all day, and still have this question: what is the equivalent for .OnAction when using a ComboBox as shown in the code below. Everything else works as desired.
Loopcntr = 1
Set xyz = ActiveSheet. OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, DisplayAsIcon:=False, _
Left:=Target.Left, Top:=Target.Top, Width:=Target.Width, Height:=Target.Height)
'''??? xyz.OnAction = "TDListing"
xyz.Object.BackColor = RGB(204, 255, 204)
Do While Loopcntr <= TaskListArraySizeHolder
DDholdName = TaskListArray(Loopcntr)
xyz.Object.AddItem DDholdName
Loopcntr = Loopcntr + 1
Loop
View 5 Replies
View Related
Feb 3, 2008
When I click a Command Button I want a label to change color FIRST and THEN a message box to appear.
I use the following code, but what happens is: FIRST, the message box appears and THEN the label changes color, which is the wrong order. The label needs to change color FIRST.
Private Sub cbA_Click()
newcolor = vbWhite
ActiveSheet. OLEObjects("label1").Object.BackColor = newcolor
MsgBox "done"
End Sub
View 6 Replies
View Related
Aug 29, 2012
I have popup calendar in a spread sheet that works fine until I share the film which produces the error in the title. Here is the code for the calender:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
'ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End Sub
[Code] ...........
View 1 Replies
View Related