Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Const xlWBATWorksheet = -4167 'Single Worksheet.
Private ExcelApp As Object
Private WorkBook As Object
Private WorkSheet As Object
Private Sub Command1_Click()
Set ExcelApp = CreateObject("Excel.Application")
Set WorkBook = ExcelApp.Workbooks.Add(xlWBATWorksheet)
Set WorkSheet = WorkBook.ActiveSheet
WorkSheet.Cells(1, 1).Value = "Hello"
ExcelApp.Visible = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Not ExcelApp Is Nothing Then
Set WorkSheet = Nothing
WorkBook.Saved = True 'Spoof so we can close out without saving.
Set WorkBook = Nothing
ExcelApp.Quit
Set ExcelApp = Nothing
End If
End Sub