Solved! Go to Solution.
' Create some Excel objects Dim EXCELApplication As Object Dim aWorkBook As Object Dim theSheets As Object Dim aSheet As Object ' Start Excel Application and create Workbook Set EXCELApplication = CreateObject("Excel.Application") If EXCELApplication Is Nothing Then Exit Sub End If With EXCELApplication .Visible = True .SheetsInNewWorkbook = 2 .DisplayStatusBar = True .StatusBar = "Please be patient, transfer in progress, Excel will minimise when completed..." .Workbooks.Add Set aWorkBook = .Workbooks(1) End With With aWorkBook .Title = "Sites Downstream of input site" .Subject = "List of downstream sites" .Comments = "This Excel file contains a list of all sites downstream of the sites in the input layer." End With ' Initialise worksheets Set theSheets = aWorkBook.Sheets theSheets.Item(1).Name = "Downstream sites" ' Blah blah blah ' Create some Excel objects Dim EXCELApplication As Object Dim aWorkBook As Object Dim theSheets As Object Dim aSheet As Object ' Start Excel Application and create Workbook Set EXCELApplication = CreateObject("Excel.Application") If EXCELApplication Is Nothing Then Exit Sub End If With EXCELApplication .Visible = True .SheetsInNewWorkbook = 2 .DisplayStatusBar = True .StatusBar = "Please be patient, transfer in progress, Excel will minimise when completed..." .Workbooks.Add Set aWorkBook = .Workbooks(1) End With With aWorkBook .Title = "Sites Downstream of input site" .Subject = "List of downstream sites" .Comments = "This Excel file contains a list of all sites downstream of the sites in the input layer." End With ' Initialise worksheets Set theSheets = aWorkBook.Sheets theSheets.Item(1).Name = "Downstream sites" ' Blah blah blahDim EXCELApplication As Object
Set EXCELApplication = CreateObject("Excel.Application")
EXCELApplication.workbooks.Open <spreadsheet name>
EXCELApplication.Visible = True