Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PageSetup with OWC10 Spreadsheet

Status
Not open for further replies.

jconterio

Programmer
Feb 13, 2003
4
US
I'm not sure how many people use the OWC for spreadsheets, but I've had an impossible time tracking down much documentation. What I do have working has been very successful and does the job really well, but it's incredibly frustrating to figure out all the OWC features.

Currently I'm trying to add a footer to each worksheet within my workbook object, and I'd like to set some print options while I'm at it. I have seen this done through the use of the 'PageSetup' tag in a few examples, but it seems to be associated with the 'Excel.Application' object instead of with 'OWC10.Spreadsheet'. The XML schema implies that I may need to use the 'WorksheetOptions' object to get to the page setup object, but I've been completely unable to find any example code of how this might be used. I'm at a total loss. Anyone have any experience with this?

The project I'm working on dynamically creates Excel spreadsheets using ASP and VBScript from a web interface. I'm running XP and have the OWC10 component installed. It seems like I can do everything _but_ access pagesetup. Argh. Thanks for any light you can shed on this.
 
Excel hierachy goes
Application
Workbook
Worksheet

The pagesetup is a property of a workSHEET
Dunno how your OWC structure works (never heard of it), but for a standard app referencing excel, this would be the syntax

With excel.application 'application object
with .activeworkbook 'or workbooks("workbookname")
with .activesheet 'or worksheets("worksheetname")
with .pagesetup
.orientation = xllandscape


etc etc etc
obbviously you don't need all the withs - they could collapse down to
with Excel.application.activeworkbook.activesheet.pagesetup
.orientation = xlLandscape
end with

HTH

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Geoff,

Thanks for the reply. Unfortunately, for some very strange reason the above doesn't work. I agree, what you've got sounds correct, and with the 'Excel.Application' object it does, but not with OWC (Office Web Component). Might be a bug in the component, or there might be a more obtuse way of referencing the page setup. It's a total mystery to me. But thanks for the input.

Anyone else have any ideas?
 
No ideas for the solution but have you tried searching MS knowledge base or any of the MS newsgroups (excel.programmers would be a good start) or even the MVPs website ( might have something.

Good luck!
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
That should, of course, read and in no way implies that mvps are muppets
[blush]

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top