ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unable to set the PaperSize property of the PageSetup class (https://www.excelbanter.com/excel-programming/315792-unable-set-papersize-property-pagesetup-class.html)

[email protected]

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.


Tom Ogilvy

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.




Vkarumbaiah

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.






All times are GMT +1. The time now is 09:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com