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 Directories


Hi,

I have 2 seerate Queries I am looking for solutions too.

1) Creat a new Directory

I want to create a directory if it dosent't exist.

MkDir allows me to create a directory but only 1 level above what i
there. i.e
if C:\Wages\ then I can create C:\Wages\Jan
but it will not let me create them if C:Wages is not there.
Is there a way to create more then 1 level in the code or do I have t
llop through it.

2) If I have a button on the screen, is there a way to get the cel
reference that it is on. I have about 10 buttons on the screen an
dependant on which one is selected I want to select a certain range o
cells.
Is it possible to know what cell is below a button or link a button t
the cell ?

Thanks
Bria

--
wardide
-----------------------------------------------------------------------
wardides's Profile: http://www.excelforum.com/member.php...fo&userid=1502
View this thread: http://www.excelforum.com/showthread.php?threadid=26685

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating Directories

For buttons from the forms toolbar

set cell = Activesheet.Buttons(1).TopLeftCell

for commandbuttons from the control toolbox toolbar

set cell = ActiveSheet.OleObjects("CommandButton1").TopLeftCe ll


On Error Resume Next
mkdir "C:\MyDir2"
mkdir "C:\MyDir2\MySubDir1"
mkdir "C:\MyDir2\MySubDir1\MySubSubDir1"
On Error goto 0




--
Regards,
Tom Ogilvy

"wardides" wrote in message
...

Hi,

I have 2 seerate Queries I am looking for solutions too.

1) Creat a new Directory

I want to create a directory if it dosent't exist.

MkDir allows me to create a directory but only 1 level above what is
there. i.e
if C:\Wages\ then I can create C:\Wages\Jan
but it will not let me create them if C:Wages is not there.
Is there a way to create more then 1 level in the code or do I have to
llop through it.

2) If I have a button on the screen, is there a way to get the cell
reference that it is on. I have about 10 buttons on the screen and
dependant on which one is selected I want to select a certain range of
cells.
Is it possible to know what cell is below a button or link a button to
the cell ?

Thanks
Brian


--
wardides
------------------------------------------------------------------------
wardides's Profile:

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



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 directories freekrill Excel Discussion (Misc queries) 1 July 25th 05 09:26 AM
Creating directories from excel Jean-Yves[_2_] Excel Programming 1 August 27th 04 05:22 PM
Excel VBA - Creating Directories th1chsn Excel Programming 3 August 26th 04 06:00 PM
Creating a list of directories mousetrap Excel Programming 1 July 24th 04 05:22 AM
Creating Directories Keith[_11_] Excel Programming 3 June 23rd 04 12:44 PM


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