Excel save & formatting questions
A few questions but as its Christmas perhaps someone will help me :-)
I'm doing some exporting from .NET into an Excel Object and I need to create a Worksheet header so the user knows what Worksheet has been Printed.
This does not seem to work can anyone advise?
[code]
oSheet.Name = "UKPX Prices"
oSheet.PageSetup.CenterHeader.Insert(0, "UKPX Prices")
oSheet.PageSetup.RightHeader.Insert(0, "Printed: " & CStr(Format(Date.Now, "dd/mm/yyyy")))
/[code]
Second, I use the following to close my excel Object, but this prompts the user for a save location and defaults to the standard Workbook Name of BookX.xls. I need to provide a name such as MyBook_ddmmyyyy.xls.
[code]
oSheet = Nothing
oBook = Nothing
appExcel.DisplayAlerts = True
appExcel.Quit()
appExcel = Nothing
\[code]
I suppose I should use
[code]
Dim db As SaveFileDialog
db.Filter = "MyBook_" & CStr(Format(Date.Now, "ddmmyyyy"))
\[code]
but I don't know how this works - how should this gthen save & get rid of the Excel Objects? Do need a Path somewhere? How does this then Save?
:)