Your easiest solution is to use an Excel workbook has a template that contains the macro and just execute the macro when the data has been written.
If you prefer to use ActiveX to set the parameters, you can build the functions you need by cascading the methods and properties just like your macro code. The difficulty is always figuring out what is a method and what is a property. Most indexed values need to be specfied with the method node Item. Your functions that you need are:
1) from the worksheet ref wire:
method node Range, wire in Cell1 and Cell2 as strings
wire worksheet ref to property node VPageBreaks
cascade method node Item, wire Index value to 1
cascade property node Location, change to write
wire in the reference from Ra
nge above
2) from the worksheet ref wire:
property node PageSetup
cascade property node PrintArea, change to write
feed in your range as a string value
3) from the worksheet ref wire:
method node Range, wire in Cell1 and Cell2 as strings
cascade property node HorizontalAlignment, change to write
wire in a constant value of -4108
Michael
www.abcdefirm.com