-
Excel ?
Does anyone know how to copy an excel worksheet?
This is what I have so far:
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
I need to copy "xlSheet".
It has a "layout" that I need on the new sheet.
Any help woul dbe great!
-
Hello Hole-In-One,
When you make a macro in excel with what you want to do, you can read the source and copy it to your program.
Nice regards,
Michelle.
-
Thanks Michelle
It works like a charm!
I think sometimes we think too hard and end up making problem more difficult than it really is!