I have a simple bit of code that calls my BO aplication.
This works fine in one database but if i copy the same into a new database it does not work. - error message - Compile error user defined type not defined and the first line of code is highligted on debug??( BOApp As busobj.Application)
Any ideas.
Option Compare Database
Option Explicit
Sub GetadjustmentData()
Dim BOApp As busobj.Application
Dim Doc As busobj.Document
Dim Rpt As busobj.Report
Set BOApp = New busobj.Application
BOApp.Visible = True
Call BOApp.LoginAs("toddj01", "toddj01", False)
Set Doc = BOApp.Documents.Open("S:\Jim Todd\Sched Data Collection\ProductData.rep")
Doc.Variables("date").Value = Format(Date - 92, "dd/mm/yyyy")
BOApp.Interactive = False
Doc.Refresh
BOApp.Interactive = True
For Each Rpt In Doc.Reports
Call Rpt.ExportAsText(Doc.Path & "\" & Rpt.name)
Next Rpt
BOApp.Quit
Set BOApp = Nothing
On Error GoTo 0
Exit Sub
err:
MsgBox "917 update failed"
End Sub
This works fine in one database but if i copy the same into a new database it does not work. - error message - Compile error user defined type not defined and the first line of code is highligted on debug??( BOApp As busobj.Application)
Any ideas.
Option Compare Database
Option Explicit
Sub GetadjustmentData()
Dim BOApp As busobj.Application
Dim Doc As busobj.Document
Dim Rpt As busobj.Report
Set BOApp = New busobj.Application
BOApp.Visible = True
Call BOApp.LoginAs("toddj01", "toddj01", False)
Set Doc = BOApp.Documents.Open("S:\Jim Todd\Sched Data Collection\ProductData.rep")
Doc.Variables("date").Value = Format(Date - 92, "dd/mm/yyyy")
BOApp.Interactive = False
Doc.Refresh
BOApp.Interactive = True
For Each Rpt In Doc.Reports
Call Rpt.ExportAsText(Doc.Path & "\" & Rpt.name)
Next Rpt
BOApp.Quit
Set BOApp = Nothing
On Error GoTo 0
Exit Sub
err:
MsgBox "917 update failed"
End Sub