Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: Setting a property of the PageSetup class


Message #1 by jeff.montgomery@m... on Thu, 12 Sep 2002 03:09:24
I wonder if anyone found a solution to this problem? I am creating an 
Excel spreadsheet with VBScript (ASP), and I am able to create the 
workbook/worksheet, fill it, and save it, then it errors when I try to set 
the page orientation. I have added a printer as per MS's Knowledge Base 
articles (at least one printer must be installed for the code to work), 
and I have used the new printer to print from Excel to make sure it works. 
However, when I try to automate Excel from ASP, I get the same error as 
Mike got below:

> 
> I'm an generating Excel spreadsheets via a Web base application (ASP &
> HTML). There are certain properties with
> the PageSetp class of the Excel.Application object that I want to set. 
But I
> get the following error when I try.
> 
> Unable to set <x> property of the PageSetup class
> <x> being the property I'm trying to set.

Jeff Montgomery
jeff.montgomery@m...
Message #2 by jeff.montgomery@m... on Sat, 14 Sep 2002 17:03:55
UPDATE: I solved this one myself. I found a solution on Microsoft's site 
under another topic: "Q184281 PRB: COM Objects Fail to Print When Called 
From ASP". This article is about print commands that fail when called from 
ASP, and it says the SYSTEM account that ASP runs the print command under 
does not have the printer installed, so you have to do some registry 
changes to install a printer for the SYSTEM account. I tried this and it 
worked for my issue as well.

Jeff Montgomery
jeff.montgomery@m...
Message #3 by jeff.montgomery@m... on Sat, 14 Sep 2002 17:09:03
Just FYI, for anyone else out there pulling their hair out over this 
issue, namely: getting an error trying to programmatically manipulate the 
Excel Worksheet.PageSetup object or a PageSetup object in other 
applications, or trying to print from ASP, I found a solution to this 
problem.

It was on Microsoft's site under another topic: "Q184281 PRB: COM Objects 
Fail to Print When Called From ASP". This article is about print commands 
that fail when called from ASP, and it says the SYSTEM account that ASP 
runs the print command under does not have the printer installed, so you 
have to do some registry changes to install a printer for the SYSTEM 
account. I tried this and it cured errors programming PageSetup as well.

Jeff Montgomery
jeff.montgomery@m...

Message #4 by jeff.montgomery@m... on Sat, 14 Sep 2002 17:10:50
oops, I inadvertently duped my post, thinking I was replying to 2 
different threads.

Jeff

  Return to Index