Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default path of workbook

With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead onl
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea ho
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me th
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabaliciou

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default path of workbook

if you use the web toolbar you can navigate to where you want to go
navigate to a file in the folder you want to open then before you clic
ok to go to it, get rid of the file name and you have a neat link to
folder. Then just copy it into your macro or do whateva you see fit t
it

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default path of workbook

ActiveWorkbook.Path



--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default path of workbook

.Path

as simple as that! Suspected that but didn't work when I tried it out
There must have been another mistake...

Cheers

F

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default path of workbook

Hi fabalicious;
ActiveWorkbook.Path
MP

"fabalicious " a écrit dans le
message de ...
With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead only
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea how
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me the
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabalicious


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default path of workbook

try
activeworkbook.path

Here is a backup file I use to backup to the current directory.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub
--
Don Guillett
SalesAid Software

"fabalicious " wrote in message
...
With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead only
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea how
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me the
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabalicious


---
Message posted from
http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default path of workbook

Don:
Thanks for the code. It works great.
Question however..
Users tend to forget to Run the macro before closing,
so quickly I thought of adding your Sub Backup() in the
Workbook BeforeClose as a one-liner, which works fine:

Only thing though is when you open the Backed-up file in the Backup folder
and then close it the code runs creating an error, since it is trying again
to backup the backup. I'm at the place of a dog chasing his tail on this.
Could you assist me?? I'm getting dizzy..
Thanks in advance.
JMay


"Don Guillett" wrote in message
...
try
activeworkbook.path

Here is a backup file I use to backup to the current directory.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub
--
Don Guillett
SalesAid Software

"fabalicious " wrote in

message
...
With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead only
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea how
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me the
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabalicious


---
Message posted from
http://www.ExcelForum.com/





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default path of workbook

Haven't thought about it but try

on error exit sub


--
Don Guillett
SalesAid Software

"JMay" wrote in message
news:IhTfc.25462$XP2.687@lakeread06...
Don:
Thanks for the code. It works great.
Question however..
Users tend to forget to Run the macro before closing,
so quickly I thought of adding your Sub Backup() in the
Workbook BeforeClose as a one-liner, which works fine:

Only thing though is when you open the Backed-up file in the Backup folder
and then close it the code runs creating an error, since it is trying

again
to backup the backup. I'm at the place of a dog chasing his tail on this.
Could you assist me?? I'm getting dizzy..
Thanks in advance.
JMay


"Don Guillett" wrote in message
...
try
activeworkbook.path

Here is a backup file I use to backup to the current directory.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub
--
Don Guillett
SalesAid Software

"fabalicious " wrote in

message
...
With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead

only
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea how
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me the
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabalicious


---
Message posted from
http://www.ExcelForum.com/







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default path of workbook

Thanks, will do.

"Don Guillett" wrote in message
...
Haven't thought about it but try

on error exit sub


--
Don Guillett
SalesAid Software

"JMay" wrote in message
news:IhTfc.25462$XP2.687@lakeread06...
Don:
Thanks for the code. It works great.
Question however..
Users tend to forget to Run the macro before closing,
so quickly I thought of adding your Sub Backup() in the
Workbook BeforeClose as a one-liner, which works fine:

Only thing though is when you open the Backed-up file in the Backup

folder
and then close it the code runs creating an error, since it is trying

again
to backup the backup. I'm at the place of a dog chasing his tail on

this.
Could you assist me?? I'm getting dizzy..
Thanks in advance.
JMay


"Don Guillett" wrote in message
...
try
activeworkbook.path

Here is a backup file I use to backup to the current directory.

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub
--
Don Guillett
SalesAid Software

"fabalicious " wrote in

message
...
With

ActiveWorkbook.FullName

i can get the full path of my active workbook. Using .Name instead

only
the file name. how can i get ONLY the path without the filename?

is there a predefined function for it? if not, has anyone any idea

how
to chop of the last bit ("/filename.xls")?

Come on, big props to the one sweetening my weekend by giving me the
illusion of having solved everything i need for my macro...
(it's 15:30 here already ;-))

Fabalicious


---
Message posted from
http://www.ExcelForum.com/









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
New Workbook Path exceluserforeman Excel Discussion (Misc queries) 2 December 7th 05 12:10 AM
Workbook path nc Excel Discussion (Misc queries) 2 April 4th 05 03:37 PM
Workbook Path Todd Huttenstine[_2_] Excel Programming 5 December 27th 03 10:02 AM
Path where Workbook is saved Todd Huttenstine[_2_] Excel Programming 3 December 2nd 03 01:50 AM
how to open workbook without hardcoding path Michael Turner Excel Programming 3 November 20th 03 12:12 PM


All times are GMT +1. The time now is 07:03 PM.

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

About Us

"It's about Microsoft Excel"