Hi:
I have the following code:
Now both of my excel workbook open, and the Dly Chart is selected from the first excel workbook. Now how do I copy that sheet into the other workbook before the summary tab in the excel workbook. That is where I am stuck.
Thanks
Zishan
I have the following code:
Code:
Public Function CopySheet()
Dim xlApp As New Excel.Application
Dim xlWB As Excel.Workbook
Dim xlwbA As Excel.Workbook
Set xlApp = New Excel.Application
Set xlWB = xlApp.Workbooks.Open("U:\Databases\Sales.xls")
Set xlwbA = xlApp.Workbooks.Open("U:\Databases\Book1.xls")
xlApp.Visible = True
xlWB.Sheets("Dly Chart").Select
xlWB.Sheets("Dly Chart").Copy Before:=xlwbA("Book1").Sheets("Summary")
Set xlApp = Nothing
Set xlWB = Nothing
Set xlwbA = Nothing
'Release database object from memory
Set dBase = Nothing
End Function
Thanks
Zishan