Martin1962
New Member
- Joined
- Mar 17, 2014
- Messages
- 10
Hi,
I have a worksheets called "Sheet1" with multiple embedded textboxes.
in a second worksheet ("Sheet2" I keep my data)
In my code I create 'Public objSheetIn, objShootOut as worksheet'
In the section "Workbook_open" I have this :
DIm shp as Shape
Set objSheetIn = Worksheets("Sheet1")
Set objSheetOut = Worksheets("Sheet2")
I check if the worksheet contains Shapes (If objSheetIn.Shapes.Count > 0 then ...)
Then I run through all shapes :
For Each shp In objSheetIn.Shapes
If Left(shp.Name, 4) = "Txt_" Then
the next instruction goes wrong (assign some text)
objSheetIn.Shapes(shp.Name).TextFrame.Characters.Text = objSheetOut.Cells(1,1)
This retuns error 438 : Object doesn't support this property or method.
Can someone please indicate what's going wrong ?
Kind regards,
Martin
I have a worksheets called "Sheet1" with multiple embedded textboxes.
in a second worksheet ("Sheet2" I keep my data)
In my code I create 'Public objSheetIn, objShootOut as worksheet'
In the section "Workbook_open" I have this :
DIm shp as Shape
Set objSheetIn = Worksheets("Sheet1")
Set objSheetOut = Worksheets("Sheet2")
I check if the worksheet contains Shapes (If objSheetIn.Shapes.Count > 0 then ...)
Then I run through all shapes :
For Each shp In objSheetIn.Shapes
If Left(shp.Name, 4) = "Txt_" Then
the next instruction goes wrong (assign some text)
objSheetIn.Shapes(shp.Name).TextFrame.Characters.Text = objSheetOut.Cells(1,1)
This retuns error 438 : Object doesn't support this property or method.
Can someone please indicate what's going wrong ?
Kind regards,
Martin