Workbook.Copy

Use this function to copy the current item in the workbook.

Syntax Parameters Return value
- This function has no parameters. This function does not return a value.

SVB Example

Copying and pasting items from a workbook:

Option Base 1
Option Explicit
Sub Main
    Dim wb As Workbook
    ' assigns the new workbook to the object wb
    Set wb = Workbooks.New("WB Example")
    'inserts the file adstudy.sta into the root folder 
    'of the workbook as the first child
    wb.InsertFile(Path & _
        "\examples\datasets\adstudy.sta",wb.Root,scWorkbookFirstChild)
    'sets the workbook to visible
    wb.Visible = True
    'copies the current item in the workbook (spreadsheet adstudy.sta)
    wb.Copy
    Dim R As Report
    'assigns the new report to the object R
    Set R = Reports.New("Report Example")
    'pastes the data located on the clipboard to the report
    r.Paste
    r.Visible = True
End Sub