View Full Version : Automating Monarch
Dion Osborn
August 7th, 2002, 01:27 PM
I built a routine in VBA/Excel that automates Monarch to print out a filtered table. Everything works fine, but I want to do more. Can I change the printer Monarch uses with my code? From looking at the documentation, I don't think I can. Has anyone tried this? Could I use Send Keys? Do I need to export the table to gain the flexibility in printers? I was hoping I could remain in Monarch. Using Automation is going to enable me to do A LOT more with Monarch.
TIA,
Dion
Melissa2
August 7th, 2002, 06:51 PM
Originally posted by Dion Osborn:
I built a routine in VBA/Excel that automates Monarch to print out a filtered table. Everything works fine, but I want to do more. Can I change the printer Monarch uses with my code? From looking at the documentation, I don't think I can. Has anyone tried this? Could I use Send Keys? Do I need to export the table to gain the flexibility in printers? I was hoping I could remain in Monarch. Using Automation is going to enable me to do A LOT more with Monarch.
TIA,
DionDion,
I'm not sure of the code you are using in excel/vba but maybe you could use:
MonarchObj.ExportTable ("c:TestExport.xls")
instead of printing directly from Monarch.
then:
Workbooks.Open FileName:="C:TestExport.xls"
to open the file in Excel
then:
Application.ActivePrinter = "enter the path of your printer here"
to change the default printer name
then:
ActiveSheet.PrintOut
to print the data.
Printing from Excel allows you to format your data to make it easier to read for the end user (which you could do automatically using VBA). I love automation <g>.
Melissa
Joel Heyman
August 7th, 2002, 10:29 PM
I use WinBatch to automate my Monarch sessions. They have a one line statement to change your default printer:
pSetDefPrt("name of printer")
MonarchObj.PrintTable(@True) then prints my table.
Sandy McQuay
August 8th, 2002, 11:45 AM
Sorry, this is not really a response to the question.
This is really directed to Joel Heyman (or anyone else) using Winbatch/OLE to automate Monarch. I'm trying to get the hang of OLE stuff and it hasn't quite clicked. I'd appreciate any tips!
Thanks,
Wes Groleau
October 26th, 2005, 05:01 PM
Originally posted by Melissa:
I'm not sure of the code you are using in excel/vba but maybe you could use:
MonarchObj.ExportTable ("c:TestExport.xls")
instead of printing directly from Monarch.
This looks like something I could use.
But don't I first have to tell Monarch the input file name and the model ?
RalphB
October 26th, 2005, 08:07 PM
Originally posted by Wes Groleau:
[/size]
quote:[/size]
Originally posted by Melissa:
I'm not sure of the code you are using in excel/vba but maybe you could use:
MonarchObj.ExportTable ("c:TestExport.xls")
instead of printing directly from Monarch.
This looks like something I could use.
But don't I first have to tell Monarch the input file name and the model ? [/size]Wes,
Check out the Monarch Programmers Guide here (http://www.datawatch.com/pdf/products/monarch/Monarch_8_Programmers_Guide.pdf) .
It gives sample codes that shows how to use the OLE commands. Some of the commands only work on newer versions but many will work on your version.
If you have any other questions on how to do some coding, post back here. There are several users that use vb to automate Monarch.
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.