How to get info of new filename and new path

M

Makelei

Hi,
I have tried to figure out how can I get information on
a) New file name that user wants to save the current file with
b) Path to new location that user wants to save the file

I havve used:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

But I am stuck. I am able to get the current name and path, but that is not
what I need... Please, help me.
Thanks in advance
Makelei
 
S

Sheeloo

Do you want it before or after the user has saved the current file to a new
name in a new directory?

I don't think you can get it BEFORE... as there is no BEFORE till the user
makes a choice...

You can get it using Cell formula and then you can do whatever you want with
it...
rename, delete the new name etc...
 
M

Makelei

Thanks Sheeloo,
This is how I did it:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
....
If ActiveWorkbook.Saved Then
FName = ActiveWorkbook.Name
Filename = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
...
Else
...
End if
....
End Sub

BR
MakeLei
 

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

Top