LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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/









 
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 05:39 AM.

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"