Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a new folder


Hi, I've written a code that pulls raw data into a variety of differen
workbooks, as this is happening i wuld also like to create an audi
trail which includes the original filename and todays date. I believ
that i can do this in some fashion already.

It would probably be best if when a new trail is created all th
associated files are saved in the same folder, preferabley with today
date. What is the best way to create a new folder from vba,

I was thinking something along the lines of

string1 = workbook.fullname and format(date)

mkdir string1

But ive also heard about filesys.createfolder ?

Has anyone else been faced with a similar task

--
cereldin
-----------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...fo&userid=3206
View this thread: http://www.excelforum.com/showthread.php?threadid=54115

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Creating a new folder

Go with MkDir. It is simple and works.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"cereldine" wrote
in message ...

Hi, I've written a code that pulls raw data into a variety of different
workbooks, as this is happening i wuld also like to create an audit
trail which includes the original filename and todays date. I believe
that i can do this in some fashion already.

It would probably be best if when a new trail is created all the
associated files are saved in the same folder, preferabley with todays
date. What is the best way to create a new folder from vba,

I was thinking something along the lines of

string1 = workbook.fullname and format(date)

mkdir string1

But ive also heard about filesys.createfolder ?

Has anyone else been faced with a similar task?


--
cereldine
------------------------------------------------------------------------
cereldine's Profile:

http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=541158



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Creating a new folder

It sounds like you are referring to the Scripting runtimes
FileSystemObject. It is worth using as it wraps a lot of oft-needed
functionality in a very easy to use manner. To use it you need to
reference the library from the VBA editor by going to Tools -
References... From there you should find "Microsoft Scipting Runtime",
check the box and you're ready to go. An example of doing what you
wanted is below. I would highly recommend searching for
filesystemobject in the vba help - it's a great resource. Is this what
you were thinking of?

Sub CreateDirectory(Path As String)

Dim fso As Scripting.FileSystemObject

Set fso = New Scripting.FileSystemObject

fso.CreateFolder (Path)

End Sub

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
Creating a folder dan Excel Discussion (Misc queries) 5 September 27th 07 04:12 PM
Creating a folder peter.thompson[_41_] Excel Programming 2 January 14th 06 08:13 AM
Creating Folder Folder in My Documents VBA - HELP Ali[_4_] Excel Programming 3 July 25th 05 02:17 PM
Creating a folder automatically Hari[_3_] Excel Programming 8 June 9th 04 06:00 PM
creating folder Lawson Excel Programming 1 December 3rd 03 01:16 AM


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