Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.
Public Sub AuditsDue1_xlFile() ' Late Binding (Needs no reference set) Dim oXL As Excel.Application 'Dim oExcel As Object Dim sFullPath As String 'Dim sPath As String Dim conn As ADODB.Connection Dim rst As ADODB.Recordset Set rst = New ADODB.Recordset Set conn = CurrentProject.Connection rst.Open "qryHFAuditsDue1", conn, adOpenForwardOnly, adLockReadOnly ' Create a new Excel instance 'Set oXL = CreateObject("Excel.Application") Set oXL = New Excel.Application ' Only XL 97 supports UserControl Property On Error Resume Next oXL.UserControl = True On Error GoTo 0 ' Full path of excel file to open On Error GoTo ErrHandle sFullPath = "C:\Temp\AuditsDue.xlt" ' Open it With oXL .Visible = True .Workbooks.Add (sFullPath) .Cells(2, 1).CopyFromRecordset rst End With rst.Close Set rst = Nothing ErrExit: Set oXL = Nothing Exit Sub ErrHandle: oXL.Visible = False MsgBox Err.Description GoTo ErrExit End Sub
|Performance issues with ODBC connections using queries and form built for search criterias in Access 2007||18||41|
|Trying to lock certain controls by calling function||7||37|
|How to get the MS access function DSUM to work?||4||31|
|Copy a row in MS Access but with some field values changed||8||26|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!