ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with Excel Header/Footer from .NET ??? (https://www.excelbanter.com/excel-programming/349384-problem-excel-header-footer-net.html)

Patrice[_3_]

Problem with Excel Header/Footer from .NET ???
 
The following code :

Public Class c
Shared Sub main()
Dim obj As Object
Dim wbk As Object
Dim wks As Object
obj = CreateObject("Excel.Application")
'bj.Visible = True
wbk = obj.WorkBooks.Add
wks = wbk.WorkSheets("Feuil1")
obj.visible = True
wks.Cells(1, 1).Value = "A"
wks.PageSetup.CenterFooter = "Page &N"
MsgBox(wks.PageSetup.CenterFooter)
obj = Nothing
End Sub
End Class

The &N code should display the page number. Instead it shows the workbook
file name ? The same code works in Excel VBA. Looks like some kind of
interaction with Excel/.NET.

Is this a known problem ? I'm using a French version of Excel in case it
matters...

TIA for any advice...




All times are GMT +1. The time now is 05:19 PM.

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