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

Hi,

How can i create a direcory using VBA if it do not exists?

for eg. when i click my command button i want to copy
sheet2,sheet3, sheet4 to c:\BkUp\FileName.. so that if
the direcory exixts it will save the file or create BkUp
directory and save the file ???

TIA
Soniya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Create directory

Here is a backup macro I use which should be of help. It will make the
directory if it doesn't already exist.

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

"Soniya" wrote in message
...
Hi,

How can i create a direcory using VBA if it do not exists?

for eg. when i click my command button i want to copy
sheet2,sheet3, sheet4 to c:\BkUp\FileName.. so that if
the direcory exixts it will save the file or create BkUp
directory and save the file ???

TIA
Soniya



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
how do I create a quick directory of sheets in workbook Momturbo Excel Discussion (Misc queries) 2 December 11th 08 09:28 PM
Create Directory Structure from Cell Value. [email protected] Excel Discussion (Misc queries) 0 December 3rd 07 09:02 PM
how can i create a telephone directory from an excel sheet tal Excel Discussion (Misc queries) 1 October 15th 07 09:20 AM
How can I create a class reunion directory from a spreadsheet? BRENDA Excel Discussion (Misc queries) 3 October 27th 05 04:09 PM
Create a Backup in Different Directory [email protected] Excel Discussion (Misc queries) 1 August 2nd 05 09:27 PM


All times are GMT +1. The time now is 09:44 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"