0

I am using the following code to create a log file but getting an error
"User-defined type not defined"
Help me
Thanks in advance

Sub main()
Dim dDate As Date
Dim boDP As busobj.DataProvider  'error occured
Dim sLast As String
Dim sFileName As String
Dim sDir As String
Dim dTime As Integer
Dim MyTime As String

''''''Define the path to save the file to
'sDir = "\\ReportDB\CIC\"
sDir = "C:\sample\test"
'Application.Interactive = False
ActiveDocument.Refresh
Set boDP = ActiveDocument.DataProviders.Item(1)
sLast = boDP.LastExecutionDate
MyTime = boDP.LastExecutionTime
'The line below captures the last time the report was refreshed.
dDate = CDate(sLast)
dTime = CDate(MyTime)
sFileName = sDir & ActiveDocument.Name & "(" & CStr(Month(dDate)) & "-" & CStr(Day(dDate)) & "-" & CStr(Year(dDate)) & "_" & CStr(Time(dTime)) & ")" & ".pdf"
ActiveDocument.Reports.Item(1).ExportAsPDF (sFileName)
End Sub
2
Contributors
3
Replies
15
Views
3 Years
Discussion Span
Last Post by bullet_1
0

I got an error in above code as "user-defined type not defined"
can anybody help me
thanks in advance

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.