Does anyone know how to copy an excel worksheet?
This is what I have so far:
I need to copy "xlSheet".Code:Dim XL As New Excel.Application Dim XlSheet As Excel.Worksheet Dim xlsheet2 As Excel.Worksheet Dim strXLFile = "C:\Order Form.xls" If XL Is Nothing Then MsgBox("Cant create excel object.") Exit Sub End If Try XlSheet = XL.Workbooks.Open(strXLFile).Worksheets("Custom Order Form 1F ver 22") Catch MsgBox("Couldn't open or find :" & strXLFile & ". Error message = " & Err.Description & _ ". Error number = " & Err.Number) XlSheet = Nothing XL = Nothing Exit Sub End Try XL.Visible = True
It has a "layout" that I need on the new sheet.
Any help woul dbe great!




Reply With Quote