#1   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Run-time error?

I have a command button that executes many different subs. It will not
execute the following sub (written inside sheet13(summ)):

Sub SummAddTextBoxHeaders()

'TPTB
Sheets("Summ").Activate
ActiveSheet.Cells(56 + (TPTB.Height - 66) / 12, 1).Select
With Selection
.Value = "Tech & Proj. Data Project Engineer Summary:"
.Font.Bold = True
End With

End Sub

It gives the following error:

Run-time error '-2147417848(80010108)':
Method 'Run' of object '_Application' failed

I can run it by stepping through it with no problems. The offending line
when using the command button is:

ActiveSheet.Cells(56 + (TPTB.Height - 66) / 12, 1).Select

(If I comment this line and the ones below it, I have no problems.) I have
tried placing the routine in other locations with no success. Any help would
be greatly appreciated. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default Run-time error?


Could it be that the division can give a non-integer answer?


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=551194

  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Run-time error?

I'm not quite sure what you intent was, but I created a textbox, using the
default name of "Rectangle 1", and assigned it to a Shape object varaible.

The code ran fine, inserting your stated text value at row 53

Here's the modified code:

Dim TPTB As Shape

Set TPTB = ActiveSheet.Shapes("Rectangle 1")

ActiveSheet.Cells(56 + (TPTB.Height - 66) / 12, 1).Select
With Selection
.Value = "Tech & Proj. Data Project Engineer Summary:"
.Font.Bold = True
End With

--
Kevin Backmann


"CWillis" wrote:

I have a command button that executes many different subs. It will not
execute the following sub (written inside sheet13(summ)):

Sub SummAddTextBoxHeaders()

'TPTB
Sheets("Summ").Activate
ActiveSheet.Cells(56 + (TPTB.Height - 66) / 12, 1).Select
With Selection
.Value = "Tech & Proj. Data Project Engineer Summary:"
.Font.Bold = True
End With

End Sub

It gives the following error:

Run-time error '-2147417848(80010108)':
Method 'Run' of object '_Application' failed

I can run it by stepping through it with no problems. The offending line
when using the command button is:

ActiveSheet.Cells(56 + (TPTB.Height - 66) / 12, 1).Select

(If I comment this line and the ones below it, I have no problems.) I have
tried placing the routine in other locations with no success. Any help would
be greatly appreciated. Thank you.

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
Run Time error 1004 Steph Excel Discussion (Misc queries) 1 May 4th 06 10:29 PM
Run time error '91' object variable-explain in plain english?? KristyBT Excel Discussion (Misc queries) 2 April 27th 06 07:53 PM
run time error 1004 for other user [email protected] Excel Discussion (Misc queries) 1 January 26th 06 09:42 AM
Help needed with Run Time Error 1004 Manesh Excel Discussion (Misc queries) 0 April 4th 05 05:07 AM
How do you sum a range of more than 30 cells. I get error each time I try. Joseph Conaghan via OfficeKB.com Excel Worksheet Functions 5 March 21st 05 10:15 PM


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