|
-
Dec 18th, 2003, 09:31 AM
#1
Thread Starter
Addicted Member
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?
-
Dec 18th, 2003, 09:53 AM
#2
Thread Starter
Addicted Member
I've got the Save bit sorted, but still cannot get a Header (or Footer for that matter).
Still need your help people
-
Dec 18th, 2003, 10:33 AM
#3
Thread Starter
Addicted Member
All resolved now, but a new question for you.
Why does the Excel Object persist for a time even after calling obj.Quit() ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|