Andresleo47
Board Regular
- Joined
- Oct 29, 2008
- Messages
- 132
Hi Community! I am trying to open one Workbook with the 2 Files (Paths) in the attached TextBoxes.
This is the code I have for now, but it's giving me an error:
Sub CommandButton1_Click()
Workbooks.Add.SaveAs Filename:="ThisWeek.xlsx"
ActiveWorkbook.Worksheets.Add Count:=1
With Sheets("Sheet1")
Workbooks.Open .TextBox1.Text
End With
With Sheets("Sheet2")
Workbooks.Open .TextBox2.Text
End With
End Sub
Any ideas would be appreciated!!
This is the code I have for now, but it's giving me an error:
Sub CommandButton1_Click()
Workbooks.Add.SaveAs Filename:="ThisWeek.xlsx"
ActiveWorkbook.Worksheets.Add Count:=1
With Sheets("Sheet1")
Workbooks.Open .TextBox1.Text
End With
With Sheets("Sheet2")
Workbooks.Open .TextBox2.Text
End With
End Sub
Any ideas would be appreciated!!