Private appEx As Excel.Application
Public Function cntExport() As Boolean
Dim k As Long, n As Long, sFN As String
On Error GoTo L_Err
cntExport = True
Set appEx = New Excel.Application
appEx.Visible = False
With appEx
.Workbooks.Open App.Path & "\Templates\cntExport.xlt"
.Cells(1, 8).Value = frmContactExport.lvP.SelectedItem.ListSubItems(8)
.Cells(1, 9).Value = frmContactExport.lvP.SelectedItem.ListSubItems(9)
.Cells(1, 10).Value = frmContactExport.lvP.SelectedItem.ListSubItems(10)
End With
appEx.ActiveWindow.Zoom = 100
appEx.Visible = True
' If boPrint Then appEx.ActiveWorkbook.PrintOut , , bCopyNumber
' appEx.ActiveWorkbook.Close
' appEx.Quit
cntExport = False
L_Exit: Screen.MousePointer = vbDefault: Set appEx = Nothing: Exit Function
L_Err: MsgBox Err.Description & " (" & Err.NUMBER & ")", vbExclamation, "cntExport": GoTo L_Exit
End Function
|