Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2007 VBA and Text Boxes

I am a new to Excel 2007. I have been using Excel and VBA for 10+ years.

My problem is I cannot get VBA in Excel 2007 to recognize Text boxes I have
on a worksheet.

I have a number of legacy (2003) workbooks that contain text boxes that are
modified by VBA code.

When I try to run the 2003 code in a 2007 workbook I get an error.....€¯Item
with the specified name wasnt found€¯

When I use the macro record in 2007 to record actions on shapes they record
nothing.

e.g. Create a text box and add text and color the box.

My result ...

Sub Macro1()
'
' Macro1 Macro
'

'
End Sub

.......absolutely nothing....I wonder if anyone could help. What am I doing
wrong?

Thanks

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Excel 2007 VBA and Text Boxes

This works fine for me

Dim wsSheet As Worksheet
Dim sButtonName As String

Set wsSheet = ActiveSheet
sButtonName = "txtTest"
wsSheet.TextBoxes(sButtonName).Formula = "=A1"

and when I recorded a macro, I got

Sub Macro2()
ActiveCell.FormulaR1C1 = "=RC"
End Sub


They have broken lots of things in 2007, but this doesn't seem to be one of
them.

--
__________________________________
HTH

Bob

"crownbec" wrote in message
...
I am a new to Excel 2007. I have been using Excel and VBA for 10+ years.

My problem is I cannot get VBA in Excel 2007 to recognize Text boxes I
have
on a worksheet.

I have a number of legacy (2003) workbooks that contain text boxes that
are
modified by VBA code.

When I try to run the 2003 code in a 2007 workbook I get an error....."Item
with the specified name wasn't found"

When I use the macro record in 2007 to record actions on shapes they
record
nothing.

e.g. Create a text box and add text and color the box.

My result ...

Sub Macro1()
'
' Macro1 Macro
'

'
End Sub

......absolutely nothing....I wonder if anyone could help. What am I doing
wrong?

Thanks

Gary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2007 VBA and Text Boxes



"Bob Phillips" wrote:

This works fine for me

Dim wsSheet As Worksheet
Dim sButtonName As String

Set wsSheet = ActiveSheet
sButtonName = "txtTest"
wsSheet.TextBoxes(sButtonName).Formula = "=A1"

and when I recorded a macro, I got

Sub Macro2()
ActiveCell.FormulaR1C1 = "=RC"
End Sub


They have broken lots of things in 2007, but this doesn't seem to be one of
them.

--
__________________________________
HTH

Bob


Hi Bob,

Thanks for that. Glad to see you too get nothing (no box identified) when
you try to record a macro to record a macro.

I can't seem to get your VBA to work.

Sorry

Gary
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
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
Tabbing between text boxes in Excel 2007 eswack Excel Discussion (Misc queries) 1 March 11th 10 11:03 PM
Spelling and text boxes in Excel 2007 Tony Excel Worksheet Functions 0 April 18th 08 09:15 PM
Excel 2007 Text Boxes Gibby Excel Discussion (Misc queries) 3 December 21st 07 02:36 PM
Superscrpts in Excel 2007 Text boxes BoJosley Excel Programming 0 December 21st 07 11:18 AM


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