Problem with Excel Header/Footer from .NET ???

P

Patrice

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top