Getting Info From Drop Down Menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was wondering if it is possible for a macro to get information from the
drop down menus; specifically the File-Save and SaveAs menus. I would like
to get the name of the file the spreadsheet is being saved as, without using
Workbook.FullName or GetSaveAsFilename. I have searched in Excel VBA help,
books and online, but haven't seen anything listed.
 
Paul,
Basically you can't. You either set the filename to use and call .SaveAs
yourself, or you let Excel handle it and see what it is after.
What do you have against GetSaveAsFilename ?

NickHK
 
Hi NickHK,

I was wanting to get the filename without having to access GetSaveAsName. I
have played a little with it, but notice it pops up a secong Dialog box after
the SaveAs menu box is opened and a name entered. Is this why you have to
set EnableEvents to false (then restore it on exiting) in the BeforeSave
handler?

Sorry, I'm just a little bit rusty on my VBA. Most of my programming in
recent years has been using C/C++ on mainframes, and I'm now having to
relearn the VB PC environment all over again.
--
Thanks,
Paul S


News said:
Paul,
Basically you can't. You either set the filename to use and call .SaveAs
yourself, or you let Excel handle it and see what it is after.
What do you have against GetSaveAsFilename ?

NickHK
 
From your description you need to the set Cancel=True, to abort Excel's
SaveAs and only excute your own.
The SaveAsUI value tells you whether the _BeforeSave event was called by a
..Save or .SaveAs so you can react accordingly.

NickHK

Paul S said:
Hi NickHK,

I was wanting to get the filename without having to access GetSaveAsName.
I
have played a little with it, but notice it pops up a secong Dialog box
after
the SaveAs menu box is opened and a name entered. Is this why you have to
set EnableEvents to false (then restore it on exiting) in the BeforeSave
handler?

Sorry, I'm just a little bit rusty on my VBA. Most of my programming in
recent years has been using C/C++ on mainframes, and I'm now having to
relearn the VB PC environment all over again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top