Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ANDYGM
 
Posts: n/a
Default Code to raise Directory request box


I have a macro which saves the spreadsheet to a new directory (currently
the directory is specified within the macro). That's OK for me but I
want to distribute the spreadsheet to a wider audience and to make it
easy for them I'd like to include a piece of code which prompts them
for the directory to save to, just the same as when you do a 'Save As'
from the spreadsheet.

As some of the directory trees are quite complex, I can't ask them to
type the directory location.

Any ideas?


--
ANDYGM
------------------------------------------------------------------------
ANDYGM's Profile: http://www.excelforum.com/member.php...fo&userid=3452
View this thread: http://www.excelforum.com/showthread...hreadid=531463

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Code to raise Directory request box

With Application.FileDialog(msoFileDialogFolderPicker)
.Show

MsgBox .SelectedItems(1)

End With

Look up FileDialog in the VBA help


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ANDYGM" wrote in
message ...

I have a macro which saves the spreadsheet to a new directory (currently
the directory is specified within the macro). That's OK for me but I
want to distribute the spreadsheet to a wider audience and to make it
easy for them I'd like to include a piece of code which prompts them
for the directory to save to, just the same as when you do a 'Save As'
from the spreadsheet.

As some of the directory trees are quite complex, I can't ask them to
type the directory location.

Any ideas?


--
ANDYGM
------------------------------------------------------------------------
ANDYGM's Profile:

http://www.excelforum.com/member.php...fo&userid=3452
View this thread: http://www.excelforum.com/showthread...hreadid=531463



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ANDYGM
 
Posts: n/a
Default Code to raise Directory request box


Thanks,

I was able to adapt your suggestion to fit what I want to do.

This is how it looks:

Dim Directory As Variant
'*****CHANGE NEW EXCEL SOURCE FILE PATH HERE******
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
Directory = .SelectedItems(1)
strNewSource = Directory & "\Report Builder v 1.2.xls"
End With
'*****CHANGE NEW EXCEL SOURCE FILE PATH HERE******


--
ANDYGM
------------------------------------------------------------------------
ANDYGM's Profile: http://www.excelforum.com/member.php...fo&userid=3452
View this thread: http://www.excelforum.com/showthread...hreadid=531463

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
regular code module billy boy Excel Discussion (Misc queries) 4 December 13th 05 07:30 PM
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
close form code tkaplan Excel Discussion (Misc queries) 1 June 3rd 05 10:49 PM


All times are GMT +1. The time now is 09:50 PM.

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"