Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
New Workbook Path | Excel Discussion (Misc queries) | |||
Workbook path | Excel Discussion (Misc queries) | |||
Workbook Path | Excel Programming | |||
Path where Workbook is saved | Excel Programming | |||
how to open workbook without hardcoding path | Excel Programming |