Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default How to get info of new filename and new path

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,805
Default How to get info of new filename and new path

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...

"Makelei" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default How to get info of new filename and new path

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
"Sheeloo" wrote:

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...

"Makelei" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
showing path and filename Annie Excel Worksheet Functions 1 February 9th 07 01:34 PM
Pulling in the path to a filename Pradhan Excel Worksheet Functions 5 November 8th 05 02:36 AM
Filename and path Mike Excel Programming 1 October 19th 05 07:33 PM
Need directory path without filename [email protected] Excel Programming 4 October 18th 05 08:56 PM


All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"