|
-
Feb 9th, 2004, 01:03 AM
#1
Thread Starter
Addicted Member
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!
-
Feb 9th, 2004, 01:49 AM
#2
Hyperactive Member
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.
Last edited by michelle; Feb 9th, 2004 at 03:49 AM.
-
Feb 9th, 2004, 12:16 PM
#3
Thread Starter
Addicted Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|