If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: access vba to write excel header and footer

Hi Gurus,

I need to use access vba to write excel header and footer. When I execute the following code, it opened up the excel file. If I did view -> header and footer, I can see the code did write the header and footer. When I try to close the excel, it asked me to save the file. If I did not save the file, the next time I opened it, the header and footer disappeared.
If I comment out the line xlBook.Application.Visible = True, it did not open the excel file and when I open the excel file manually, there is no header and footer.

I need the code to save the header and footer behind the scene without opening it. How to change the code?