Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can't enter break mode at this time
I am creating a text box in excel using the following code:
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", Link:=False, _ DisplayAsIcon:=False, Left:=3.75, Top:=722.25, Width:=222, Height:= _ 87.75).Select Question 1: Stepping through the code gives the "Can't enter break mode at this time" error. I would ignore it, but I need to step through the code to find out what is causing my other errors. Question 2: In the above code, it places the text box in the location I tell it. (Left=, Top=....) This is referenced from cell A1. Is there a way for the text box to be placed in a specific cell? (Or be referenced from a cell other than A1.). Thanks in advance. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can't enter break mode at this time
#1. I set a break point before the offending line and after the offending line
and run (F5) that offending line without stepping through it. #2. I like to use a variable that represents the object. Then I can use that variable to do other things, too. Option Explicit Sub testme() Dim myRng As Range Dim OLEObj As OLEObject Set myRng = ActiveSheet.Range("b9") With myRng Set OLEObj = .Parent.OLEObjects.Add(ClassType:="Forms.TextBox.1 ", _ Link:=False, DisplayAsIcon:=False, _ Left:=.Left, _ Top:=.Top, _ Width:=.Width, _ Height:=.Height) OLEObj.Name = "TextBoxIn_" & .Address(0, 0) End With End Sub CWillis wrote: I am creating a text box in excel using the following code: ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", Link:=False, _ DisplayAsIcon:=False, Left:=3.75, Top:=722.25, Width:=222, Height:= _ 87.75).Select Question 1: Stepping through the code gives the "Can't enter break mode at this time" error. I would ignore it, but I need to step through the code to find out what is causing my other errors. Question 2: In the above code, it places the text box in the location I tell it. (Left=, Top=....) This is referenced from cell A1. Is there a way for the text box to be placed in a specific cell? (Or be referenced from a cell other than A1.). Thanks in advance. -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can't enter break mode at this time
Thanks Dave. I haven't tried it yet since it won't open up the page I need
(See above new post) but I will try it as soon as I can. "Dave Peterson" wrote: #1. I set a break point before the offending line and after the offending line and run (F5) that offending line without stepping through it. #2. I like to use a variable that represents the object. Then I can use that variable to do other things, too. Option Explicit Sub testme() Dim myRng As Range Dim OLEObj As OLEObject Set myRng = ActiveSheet.Range("b9") With myRng Set OLEObj = .Parent.OLEObjects.Add(ClassType:="Forms.TextBox.1 ", _ Link:=False, DisplayAsIcon:=False, _ Left:=.Left, _ Top:=.Top, _ Width:=.Width, _ Height:=.Height) OLEObj.Name = "TextBoxIn_" & .Address(0, 0) End With End Sub CWillis wrote: I am creating a text box in excel using the following code: ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", Link:=False, _ DisplayAsIcon:=False, Left:=3.75, Top:=722.25, Width:=222, Height:= _ 87.75).Select Question 1: Stepping through the code gives the "Can't enter break mode at this time" error. I would ignore it, but I need to step through the code to find out what is causing my other errors. Question 2: In the above code, it places the text box in the location I tell it. (Left=, Top=....) This is referenced from cell A1. Is there a way for the text box to be placed in a specific cell? (Or be referenced from a cell other than A1.). Thanks in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
time sheet drop down lists | Excel Discussion (Misc queries) | |||
How do I enter a time in excel so it does not print as 1:00:00 PM | New Users to Excel | |||
enter a time into a cell, have the cell show two times the entry | Excel Worksheet Functions | |||
how to enter date without using "/" each time? | Excel Discussion (Misc queries) | |||
How do you enter a negative time number in Excel? | Excel Discussion (Misc queries) |