teamsimpson
New Member
- Joined
- Sep 20, 2002
- Messages
- 22
I could'nt get the code you wrote to work.Could you look at the code i nearley got to work, my problem is, the macro reads an outside excel file and puts it in an embeded object,it sizes the shape and renames it from new to data1.my problem is, the next time i run the macro, it can't handle the names, i think i need a loop or if else statement, see below
Sheets(1).OLEObjects.Add(Filename:="file.xls", Link:=False).Name = "new"
With Sheets(1).OLEObjects("new")
.Left = 100
.Top = 100
.Width = 50
.Height = 30
ActiveSheet.Shape("new").Name = "data1"
End With
Sheets(1).[a1].Active
End Sub
Sheets(1).OLEObjects.Add(Filename:="file.xls", Link:=False).Name = "new"
With Sheets(1).OLEObjects("new")
.Left = 100
.Top = 100
.Width = 50
.Height = 30
ActiveSheet.Shape("new").Name = "data1"
End With
Sheets(1).[a1].Active
End Sub