Results 1 to 3 of 3

Thread: Excel ?

  1. #1

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195

    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!

  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    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.

  3. #3

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    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
  •  



Click Here to Expand Forum to Full Width