Workbook.InsertFile
Use this function to inserts the specified file into the workbook.
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
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.