Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to set the PaperSize property of the PageSetup class

hi
Im getting an error message. i.e. "Unable to set the PaperSize property
of the PageSetup class"
when I try to set the paper size through code using VB.Net 2003 and MS
Excel 2003.
The code runs in a server side component on an application server and
creates an MS Excel report.

The line at which it fails is as below

oWorksheet.PageSetup.PaperSize =
CType(Microsoft.Office.Interop.Excel.XlPaperSize.x lPaperLetter,
Microsoft.Office.Interop.Excel.XlPaperSize)

The Error and stack trace are as below

Source Exception: Microsoft Office Excel - ForwardCallToInvokeMember
Message: Unable to set the PaperSize property of the PageSetup class
Trace: at System.RuntimeType.ForwardCallToInvokeMember(Strin g
memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes,
MessageData& msgData)
at
Microsoft.Office.Interop.Excel.PageSetup.set_Paper Size(XlPaperSize )
at ReportServer.cReportServer.ATBSummaryReport(Int32 pATBID, Int16
pRevision, Int32 pAgencyID, Int16 pCompareToRevision) in
C:\reportserver


The printer is a network printer and the drivers are installed on a
network print server which is a seperate machine.
everything works well when the component is configured to run under the
network administrator's login credentials but fails and gives me the
error above when I use an application user's credentials.

I have tried setting the default printer to another printer to rule out
a problem with the printer driver and still get this error.

What should i look for in order to correct this problem?
Thanks for your help in advance.
Vikram.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unable to set the PaperSize property of the PageSetup class

It sounds like the User ID you are using doesn't have a printer assigned.

--
Regards,
Tom Ogilvy

wrote in message
ups.com...
hi
Im getting an error message. i.e. "Unable to set the PaperSize property
of the PageSetup class"
when I try to set the paper size through code using VB.Net 2003 and MS
Excel 2003.
The code runs in a server side component on an application server and
creates an MS Excel report.

The line at which it fails is as below

oWorksheet.PageSetup.PaperSize =
CType(Microsoft.Office.Interop.Excel.XlPaperSize.x lPaperLetter,
Microsoft.Office.Interop.Excel.XlPaperSize)

The Error and stack trace are as below

Source Exception: Microsoft Office Excel - ForwardCallToInvokeMember
Message: Unable to set the PaperSize property of the PageSetup class
Trace: at System.RuntimeType.ForwardCallToInvokeMember(Strin g
memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes,
MessageData& msgData)
at
Microsoft.Office.Interop.Excel.PageSetup.set_Paper Size(XlPaperSize )
at ReportServer.cReportServer.ATBSummaryReport(Int32 pATBID, Int16
pRevision, Int32 pAgencyID, Int16 pCompareToRevision) in
C:\reportserver


The printer is a network printer and the drivers are installed on a
network print server which is a seperate machine.
everything works well when the component is configured to run under the
network administrator's login credentials but fails and gives me the
error above when I use an application user's credentials.

I have tried setting the default printer to another printer to rule out
a problem with the printer driver and still get this error.

What should i look for in order to correct this problem?
Thanks for your help in advance.
Vikram.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Unable to set the PaperSize property of the PageSetup class

Tom
this may be a silly question but, how can I assign a printer to a User ?
thnaks

Vikram

"Tom Ogilvy" wrote:

It sounds like the User ID you are using doesn't have a printer assigned.

--
Regards,
Tom Ogilvy

wrote in message
ups.com...
hi
Im getting an error message. i.e. "Unable to set the PaperSize property
of the PageSetup class"
when I try to set the paper size through code using VB.Net 2003 and MS
Excel 2003.
The code runs in a server side component on an application server and
creates an MS Excel report.

The line at which it fails is as below

oWorksheet.PageSetup.PaperSize =
CType(Microsoft.Office.Interop.Excel.XlPaperSize.x lPaperLetter,
Microsoft.Office.Interop.Excel.XlPaperSize)

The Error and stack trace are as below

Source Exception: Microsoft Office Excel - ForwardCallToInvokeMember
Message: Unable to set the PaperSize property of the PageSetup class
Trace: at System.RuntimeType.ForwardCallToInvokeMember(Strin g
memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes,
MessageData& msgData)
at
Microsoft.Office.Interop.Excel.PageSetup.set_Paper Size(XlPaperSize )
at ReportServer.cReportServer.ATBSummaryReport(Int32 pATBID, Int16
pRevision, Int32 pAgencyID, Int16 pCompareToRevision) in
C:\reportserver


The printer is a network printer and the drivers are installed on a
network print server which is a seperate machine.
everything works well when the component is configured to run under the
network administrator's login credentials but fails and gives me the
error above when I use an application user's credentials.

I have tried setting the default printer to another printer to rule out
a problem with the printer driver and still get this error.

What should i look for in order to correct this problem?
Thanks for your help in advance.
Vikram.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to get the pivotfields property of the pivottable class dhstein Excel Discussion (Misc queries) 0 January 6th 10 02:27 AM
Unable to set the formula property of the series class Malhar Charts and Charting in Excel 1 July 24th 06 05:50 PM
Unable to Set LeftFooter Property Class PageSetup (ASP) fredlankovich Excel Programming 0 June 23rd 04 07:56 PM
Unable to set the PrintQuality property of the PageSetup class. No Name Excel Programming 1 January 14th 04 04:43 PM
unable to set the colorindex property of the font class steve Excel Programming 3 December 17th 03 02:41 PM


All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"