View Single Post
  #1   Report Post  
Posted to microsoft.public.dotnet.languages.vb,microsoft.public.excel.programming
Patrice[_3_] Patrice[_3_] is offline
external usenet poster
 
Posts: 2
Default 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...