Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Button Text Problem

I Have recently installed Excel 2007 and some code that worked on previous
versions now does not work.

I am trying to create a button with 3 lines of text using the following code:

ActiveSheet.Buttons.Add(23.25, 17.25, 209.25, 87).Select
Selection.Characters.Text = "CALCULATE:" & Chr(10) & "Calcultation Step
1" & Chr(10) & "Calculation Step 2"


In previous versions of Excel this code would give me a button with 3
lines:

CALCULATE
Calculation Step 1
Calculation Step 2


In 2007 version all i get is an error message saying
"Run-time error '1004'

Can anyone explain why or suggest a way to create a button that will start a
new macro?


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Button Text Problem


Maybe Excel was "improved" again?
I don't use XL2007. However, try using a shape instead of button...
'--
With ActiveSheet.Shapes.AddFormControl(xlButtonControl, 23.25, 17.25, 209.25, 87)
With .TextFrame.Characters
.Text = "CALCULATE:" & Chr(10) & _
"Calculation Step 1" & Chr(10) & "Calculation Step 2"
.Font.Size = 12
End With
End With
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





"AndyM"

wrote in message
I Have recently installed Excel 2007 and some code that worked on previous
versions now does not work.
I am trying to create a button with 3 lines of text using the following code:

ActiveSheet.Buttons.Add(23.25, 17.25, 209.25, 87).Select
Selection.Characters.Text = "CALCULATE:" & Chr(10) & "Calcultation Step
1" & Chr(10) & "Calculation Step 2"

In previous versions of Excel this code would give me a button with 3 lines:
CALCULATE
Calculation Step 1
Calculation Step 2
In 2007 version all i get is an error message saying "Run-time error '1004'
Can anyone explain why or suggest a way to create a button that will start a
new macro?
Thanks
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
option button problem THIRDCOAST Excel Programming 1 January 7th 08 10:22 AM
Button Problem JT Excel Programming 1 November 17th 07 06:16 AM
Cut Button Problem maperalia Excel Programming 2 July 11th 07 06:18 PM
Copy Button Problem mtm4300 via OfficeKB.com Excel Programming 3 April 28th 06 07:51 PM
Option button problem Paul Excel Programming 1 July 23rd 04 02:07 PM


All times are GMT +1. The time now is 05:52 AM.

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"