Odds are that you've done this already, but in addition to your Set statement, you should [font="courier"]Dim MonarchObj as Object /font[/quote]and, what's likely missing now, set a reference to the Monarch object library in your project.
Thanks for the reply. When i dim the variable as an object it errors out. Here's the code I have:
Private Sub Monarch_Load()
Dim openfile, openmod
Set MonarchObj = CreateObject("Monarch32")
t = MonarchObj.SetLogFile("C: mpmonarch.log")
openfile = MonarchObj.SetReportFile("Z:invval_04_18_07INVVALs18.txt")
If openfile = True Then
Openmod = MonarchObj.SetModelFile("J:Inventory Valuation ReportMonarch Modelinvval_model.mod")
If openmod = True Then
MonarchObj.ExportTable("C: mp est.xls")
This is basically verbatim from the Programmers guide except It doesnt allow me to declare the variables as an object or boolean.
You have two commands that don't have fully qualified parameters.
Change your code:[quote][font="courier"]t = MonarchObj.SetLogFile("C: mpmonarch.log")
openfile = MonarchObj.SetReportFile("Z:invval_04_18_07INVVALs18.txt")[/font][/quote]To
openfile = MonarchObj.SetReportFile("Z:invval_04_18_07INVVALs18.txt", False)[/font][/quote]For SetLogFile:
True = new messages are appended to the log file
False = the previous contents of the log file are deleted
True = the report is added to the list of open reports
False = all other reports are closed before opening the new report.
Everything else should work just fine.
FYI: For a decent VBScript editor/debugger, take a look at [url="http://www.vbsedit.com/"]VBSEdit[/url]
You are correct, VBScript doesn't allow you to declare the TYPE of variables, you can only DIM them.
Hope that helps!