In een modele welke een export Excel creeert geeft hij steeds de melding:
"een door een gebruiker gedefinieerd gegevenstype is niet gedefinieerd"
Bij de regel Dim appExcel As Excel.application.
De code is:
Public Function ExportToExcel()
On Error GoTo ErrorHandler
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strWorksheetPath As String
Dim appExcel As Excel.Application
Dim strTemplatePath As String
Dim bks As Excel.Workbooks
Dim rng As Excel.Range
Dim rngStart As Excel.Range
Dim strTemplateFile As String
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim lngCount As Long
Dim strPrompt As String
Dim strTitle As String
Dim strTemplateFileAndPath As String
Dim prps As Object
Dim strSaveName As String
Dim strTestFile As String
Dim strDefault As String
Set appExcel = GetObject(, “Excel.Application”)
strTemplatePath = GetWorksheetTemplatesPath
strTemplateFile = “Access Contacts.xltx”
strTemplateFileAndPath
Wat moet ik doen om dit te verhelpen.
Thanks,
Peter
"een door een gebruiker gedefinieerd gegevenstype is niet gedefinieerd"
Bij de regel Dim appExcel As Excel.application.
De code is:
Public Function ExportToExcel()
On Error GoTo ErrorHandler
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strWorksheetPath As String
Dim appExcel As Excel.Application
Dim strTemplatePath As String
Dim bks As Excel.Workbooks
Dim rng As Excel.Range
Dim rngStart As Excel.Range
Dim strTemplateFile As String
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim lngCount As Long
Dim strPrompt As String
Dim strTitle As String
Dim strTemplateFileAndPath As String
Dim prps As Object
Dim strSaveName As String
Dim strTestFile As String
Dim strDefault As String
Set appExcel = GetObject(, “Excel.Application”)
strTemplatePath = GetWorksheetTemplatesPath
strTemplateFile = “Access Contacts.xltx”
strTemplateFileAndPath
Wat moet ik doen om dit te verhelpen.
Thanks,
Peter