M
Miha Abrahamsberg
Hi!
I'm using Lebans ReportToPDF and it works great.
But some time ago I started receiving "Compile Error: User-defined type not
defined" when compiling my project. But this not effect the performance of
converting reports to PDF.
The compiling error pops-at for a module containing the fFileDialog()
function at:
###
Set clsDialog = New clsCommonDialog
###
How do I compile?
Thanks in advance!
Miha
################################################
'The complete function code (in the module):
Private Function fFileDialog() As String
' Calls the API File Save Dialog Window
' Returns full path to new File
On Error GoTo Err_fFileDialog
' Call the File Common Dialog Window
Dim clsDialog As Object
Dim strTemp As String
Dim strFname As String
Set clsDialog = New clsCommonDialog
' Fill in our structure
' I'll leave in how to select Gif and Jpeg to
' show you how to build the Filter in case you want
' to use this code in another project.
clsDialog.Filter = "PDF (*.PDF)" & Chr$(0) & "*.PDF" & Chr$(0)
'clsDialog.Filter = clsDialog.Filter & "Gif (*.GIF)" & Chr$(0) & "*.GIF" &
Chr$(0)
'clsDialog.Filter = "ALL (*.*)" & Chr$(0) & "*.*" & Chr$(0)
clsDialog.hDC = 0
clsDialog.MaxFileSize = 256
clsDialog.Max = 256
clsDialog.FileTitle = vbNullString
clsDialog.DialogTitle = "Please Select a path and Enter a Name for the PDF
File"
clsDialog.InitDir = vbNullString
clsDialog.DefaultExt = vbNullString
' Display the File Dialog
clsDialog.ShowSave
' See if user clicked Cancel or even selected
' the very same file already selected
strFname = clsDialog.fileName
'If Len(strFname & vbNullString) = 0 Then
' Raise the exception
' Err.Raise vbObjectError + 513, "clsPrintToFit.fFileDialog", _
'"Please type in a Name for a New File"
'End If
' Return File Path and Name
fFileDialog = strFname
Exit_fFileDialog:
Err.Clear
Set clsDialog = Nothing
Exit Function
Err_fFileDialog:
fFileDialog = ""
MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
Resume Exit_fFileDialog
End Function
############################################################
I'm using Lebans ReportToPDF and it works great.
But some time ago I started receiving "Compile Error: User-defined type not
defined" when compiling my project. But this not effect the performance of
converting reports to PDF.
The compiling error pops-at for a module containing the fFileDialog()
function at:
###
Set clsDialog = New clsCommonDialog
###
How do I compile?
Thanks in advance!
Miha
################################################
'The complete function code (in the module):
Private Function fFileDialog() As String
' Calls the API File Save Dialog Window
' Returns full path to new File
On Error GoTo Err_fFileDialog
' Call the File Common Dialog Window
Dim clsDialog As Object
Dim strTemp As String
Dim strFname As String
Set clsDialog = New clsCommonDialog
' Fill in our structure
' I'll leave in how to select Gif and Jpeg to
' show you how to build the Filter in case you want
' to use this code in another project.
clsDialog.Filter = "PDF (*.PDF)" & Chr$(0) & "*.PDF" & Chr$(0)
'clsDialog.Filter = clsDialog.Filter & "Gif (*.GIF)" & Chr$(0) & "*.GIF" &
Chr$(0)
'clsDialog.Filter = "ALL (*.*)" & Chr$(0) & "*.*" & Chr$(0)
clsDialog.hDC = 0
clsDialog.MaxFileSize = 256
clsDialog.Max = 256
clsDialog.FileTitle = vbNullString
clsDialog.DialogTitle = "Please Select a path and Enter a Name for the PDF
File"
clsDialog.InitDir = vbNullString
clsDialog.DefaultExt = vbNullString
' Display the File Dialog
clsDialog.ShowSave
' See if user clicked Cancel or even selected
' the very same file already selected
strFname = clsDialog.fileName
'If Len(strFname & vbNullString) = 0 Then
' Raise the exception
' Err.Raise vbObjectError + 513, "clsPrintToFit.fFileDialog", _
'"Please type in a Name for a New File"
'End If
' Return File Path and Name
fFileDialog = strFname
Exit_fFileDialog:
Err.Clear
Set clsDialog = Nothing
Exit Function
Err_fFileDialog:
fFileDialog = ""
MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
Resume Exit_fFileDialog
End Function
############################################################