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.
Function Export()
Dim xlobj As Object
Dim objWKB As Object, objSHT As Object
Dim rs As DAO.Recordset
Dim db As Database
Dim strSh As String
Const conSHEET1 = "SHARES"
Const conBK = "C:\Documents and Settings\Workstation\Desktop\Shares.xls"
Set xlobj = CreateObject("excel.application")
Set db = CurrentDb
xlobj.Application.Visible = True
With xlobj
.workbooks.Open filename:=conBK
strSh = ("SELECT D1NAME AS NAME, MEMBER_NBR FROM tblShares")
Set rs = db.OpenRecordset(strSh, dbOpenSnapshot)
Set objSHT = .worksheets(conSHEET1)
With objSHT
.range("A1").copyfromrecordset rs
End With
.activeworkbook.Close savechanges:=True
xlobj.Quit
End With
Set xlobj = Nothing
End Function