Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default 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
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
time sheet drop down lists Steve Excel Discussion (Misc queries) 12 March 18th 06 10:30 PM
How do I enter a time in excel so it does not print as 1:00:00 PM Geet New Users to Excel 1 February 8th 06 10:29 PM
enter a time into a cell, have the cell show two times the entry johnp Excel Worksheet Functions 3 May 2nd 05 12:08 AM
how to enter date without using "/" each time? magstate Excel Discussion (Misc queries) 2 March 23rd 05 08:45 PM
How do you enter a negative time number in Excel? Thomas99 Excel Discussion (Misc queries) 4 March 17th 05 11:42 PM


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