Discussion:
VSTO - rename workbook
(too old to reply)
BrassicaNigra
2009-10-12 16:40:02 UTC
Permalink
Greetings,

Is there a way to rename a workbook using VSTO without saving it?

Thanks,

Dale Hoffman
Colbert Zhou [MSFT]
2009-10-13 08:23:58 UTC
Permalink
Hello Dale,

The answer is NO. I quote the following from the MSDN documentation,
(http://msdn.microsoft.com/en-us/library/aa224504(office.11).aspx)

"The Name property returns the workbook name. You cannot set the name by
using this property; if you need to change the name, use the SaveAs method
to save the workbook under a different name."

What is purpose to rename a opened Workbook without saving? If you just
want to change the Excel window title text, you can set the Window.Caption
property
"The window caption is the text shown in the title bar at the top of the
window when the window isn't maximized. The caption is also shown in the
list of open files on the bottom of the Windows menu. Use the Caption
property to set or return the window caption. Changing the window caption
doesn't change the name of the workbook."
http://msdn.microsoft.com/en-us/library/aa224502(office.11).aspx

Hope this clarifies!

Have a nice day Sir!


Best regards,
Ji Zhou
Managed Newsgroup Support Team

Loading...