How can I open an existing Workbook within my procedure?
I need something to use instead of line #8.
I need something to use instead of line #8.
Code:
Private Sub View_Record_Click()
Dim objXL As Object
Dim newbook As Excel.Workbook
Dim newsht1 As Excel.Worksheet
Set objXL = CreateObject(Class:="Excel.Application")
Set newbook = objXL.Workbooks.Add
' Here instead of add, i want add already existing worksheet
Set newsht1 = newbook.Sheets("Sheet1")
newsht1.Shapes.AddShape(msoShapeRectangle, 89.25, 72.75, 113.25, 92.25).Select
objXL.Visible = True
End Sub
Comment