ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XL4 error executing Page.Setup function (https://www.excelbanter.com/excel-programming/387686-xl4-error-executing-page-setup-function.html)

JackCali

XL4 error executing Page.Setup function
 
I tried to use XL4 Page.Setup function to speed up setting properties and I
received an error when trying to apply a font and font style to the header or
footer text. I'm using C# .NET 2.0 to make the call into Excel. Can someone
tell me what I am doing wrong with the below Page.Setup function?

"PAGE.SETUP(\"&L&\"Arial, Bold\"&14U_LEVEL&R&\"Arial,
Bold\"&14U_LEVEL\",\"&L&\"Arial, Bold\"&14U_LEVEL&R&\"Arial,
Bold\"&14U_LEVEL\",,,,,,,,,,,,,,,,0.025,0.30,,)"

Error message received:
The formula you typed contains an error. For information about fixing
common formula problems, click Help. To get assistance in entering a
function, click OK, then click Function on the Insert menu. If you are not
trying to enter a formula, avoi...

If I remove the font and font style, then the function executes successfully.
"PAGE.SETUP(\"&L&14U_LEVEL&R&14U_LEVEL\",\"&L&14U_ LEVEL&R&14U_LEVEL\",,,,,,,,,,,,,,,,0.025,0.30,,)"

Thanks,
Jack


JackCali

XL4 error executing Page.Setup function
 
Jim - Thanks for the suggestion but the slash is needed before the text (c#
syntax) to have double quotation marks around fontname and fontstyle.

jack

"Jim Rech" wrote:

I didn't run your code but I think that the slash before the "Arial"'s
should be inside the quotes.

--
Jim
"JackCali" wrote in message
...
|I tried to use XL4 Page.Setup function to speed up setting properties and I
| received an error when trying to apply a font and font style to the header
or
| footer text. I'm using C# .NET 2.0 to make the call into Excel. Can
someone
| tell me what I am doing wrong with the below Page.Setup function?
|
| "PAGE.SETUP(\"&L&\"Arial, Bold\"&14U_LEVEL&R&\"Arial,
| Bold\"&14U_LEVEL\",\"&L&\"Arial, Bold\"&14U_LEVEL&R&\"Arial,
| Bold\"&14U_LEVEL\",,,,,,,,,,,,,,,,0.025,0.30,,)"
|
| Error message received:
| The formula you typed contains an error. For information about fixing
| common formula problems, click Help. To get assistance in entering a
| function, click OK, then click Function on the Insert menu. If you are not
| trying to enter a formula, avoi...
|
| If I remove the font and font style, then the function executes
successfully.
|
"PAGE.SETUP(\"&L&14U_LEVEL&R&14U_LEVEL\",\"&L&14U_ LEVEL&R&14U_LEVEL\",,,,,,,,,,,,,,,,0.025,0.30,,)"
|
| Thanks,
| Jack
|





All times are GMT +1. The time now is 12:02 AM.

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