PC Review


Reply
Thread Tools Rate Thread

Another Question about Save As Dialog box

 
 
Pete Rooney
Guest
Posts: n/a
 
      10th Apr 2008
Good morning,

I want to be able to display the Save As Dialog box - but - before I do it,
I want to change the default Save As folder to whatever value is contained in
a cell on a worksheet so when the dialog is displayed, it's pointing to the
specified folder.

Ideally, I also want the filename box to contain a value contained in
another variable, based on other cells in the worksheet, which I don't have a
problem with, so that the Save As dialog box shows the variablein the File
Name field, but which the user has the opportunity to change before clicking
"Save".

So far, here's what I have, but the first problem is, when the dialog box is
displayed, the folder showing is the one where the workbook was last saved,
NOT the folder based on the value in the cell.

The value in the folder cell is valid, as I don't get an error message at
the CHDIR command - it just isn't reflected in the SaveAs dialog box.

Also, I don't have any idea yet as to how to put the user-amendable value in
the File Name field yet.


Here's what I have so far:


Sub AATest()

Dim DropDownsSheet As Worksheet
Dim DefaultFolderCell As Range
Dim DefaultFolderValue As String

Set DropDownsSheet = ActiveWorkbook.Worksheets("Dropdowns")
Set DefaultFolderCell = DropDownsSheet.Range("DefaultFolder")
DefaultFolderValue = DefaultFolderCell.Value

MsgBox (DefaultFolderValue)
ChDir DefaultFolderValue
Application.Dialogs(xlDialogSaveAs).Show
End Sub

Thanks in advance for your help.

Regards

Pete
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      10th Apr 2008
Pete,

Try this

Sub AATest()
savedir = Sheets("Sheet1").Range("A1").Value
fname = Sheets("Sheet1").Range("A2").Value
Application.Dialogs(xlDialogOpen).Show ("c:\" & savedir & "\" & fname)
End Sub

Mike

"Pete Rooney" wrote:

> Good morning,
>
> I want to be able to display the Save As Dialog box - but - before I do it,
> I want to change the default Save As folder to whatever value is contained in
> a cell on a worksheet so when the dialog is displayed, it's pointing to the
> specified folder.
>
> Ideally, I also want the filename box to contain a value contained in
> another variable, based on other cells in the worksheet, which I don't have a
> problem with, so that the Save As dialog box shows the variablein the File
> Name field, but which the user has the opportunity to change before clicking
> "Save".
>
> So far, here's what I have, but the first problem is, when the dialog box is
> displayed, the folder showing is the one where the workbook was last saved,
> NOT the folder based on the value in the cell.
>
> The value in the folder cell is valid, as I don't get an error message at
> the CHDIR command - it just isn't reflected in the SaveAs dialog box.
>
> Also, I don't have any idea yet as to how to put the user-amendable value in
> the File Name field yet.
>
>
> Here's what I have so far:
>
>
> Sub AATest()
>
> Dim DropDownsSheet As Worksheet
> Dim DefaultFolderCell As Range
> Dim DefaultFolderValue As String
>
> Set DropDownsSheet = ActiveWorkbook.Worksheets("Dropdowns")
> Set DefaultFolderCell = DropDownsSheet.Range("DefaultFolder")
> DefaultFolderValue = DefaultFolderCell.Value
>
> MsgBox (DefaultFolderValue)
> ChDir DefaultFolderValue
> Application.Dialogs(xlDialogSaveAs).Show
> End Sub
>
> Thanks in advance for your help.
>
> Regards
>
> Pete

 
Reply With Quote
 
Pete Rooney
Guest
Posts: n/a
 
      10th Apr 2008
Mike,

Off to a meeting now, but will try it when I get back.
Thanks
Pete



"Mike H" wrote:

> Pete,
>
> Try this
>
> Sub AATest()
> savedir = Sheets("Sheet1").Range("A1").Value
> fname = Sheets("Sheet1").Range("A2").Value
> Application.Dialogs(xlDialogOpen).Show ("c:\" & savedir & "\" & fname)
> End Sub
>
> Mike
>
> "Pete Rooney" wrote:
>
> > Good morning,
> >
> > I want to be able to display the Save As Dialog box - but - before I do it,
> > I want to change the default Save As folder to whatever value is contained in
> > a cell on a worksheet so when the dialog is displayed, it's pointing to the
> > specified folder.
> >
> > Ideally, I also want the filename box to contain a value contained in
> > another variable, based on other cells in the worksheet, which I don't have a
> > problem with, so that the Save As dialog box shows the variablein the File
> > Name field, but which the user has the opportunity to change before clicking
> > "Save".
> >
> > So far, here's what I have, but the first problem is, when the dialog box is
> > displayed, the folder showing is the one where the workbook was last saved,
> > NOT the folder based on the value in the cell.
> >
> > The value in the folder cell is valid, as I don't get an error message at
> > the CHDIR command - it just isn't reflected in the SaveAs dialog box.
> >
> > Also, I don't have any idea yet as to how to put the user-amendable value in
> > the File Name field yet.
> >
> >
> > Here's what I have so far:
> >
> >
> > Sub AATest()
> >
> > Dim DropDownsSheet As Worksheet
> > Dim DefaultFolderCell As Range
> > Dim DefaultFolderValue As String
> >
> > Set DropDownsSheet = ActiveWorkbook.Worksheets("Dropdowns")
> > Set DefaultFolderCell = DropDownsSheet.Range("DefaultFolder")
> > DefaultFolderValue = DefaultFolderCell.Value
> >
> > MsgBox (DefaultFolderValue)
> > ChDir DefaultFolderValue
> > Application.Dialogs(xlDialogSaveAs).Show
> > End Sub
> >
> > Thanks in advance for your help.
> >
> > Regards
> >
> > Pete

 
Reply With Quote
 
Pete Rooney
Guest
Posts: n/a
 
      10th Apr 2008
Mike,

Yep - this took me to where I needed to be.

Thank you! :-)

Pete



"Mike H" wrote:

> Pete,
>
> Try this
>
> Sub AATest()
> savedir = Sheets("Sheet1").Range("A1").Value
> fname = Sheets("Sheet1").Range("A2").Value
> Application.Dialogs(xlDialogOpen).Show ("c:\" & savedir & "\" & fname)
> End Sub
>
> Mike
>
> "Pete Rooney" wrote:
>
> > Good morning,
> >
> > I want to be able to display the Save As Dialog box - but - before I do it,
> > I want to change the default Save As folder to whatever value is contained in
> > a cell on a worksheet so when the dialog is displayed, it's pointing to the
> > specified folder.
> >
> > Ideally, I also want the filename box to contain a value contained in
> > another variable, based on other cells in the worksheet, which I don't have a
> > problem with, so that the Save As dialog box shows the variablein the File
> > Name field, but which the user has the opportunity to change before clicking
> > "Save".
> >
> > So far, here's what I have, but the first problem is, when the dialog box is
> > displayed, the folder showing is the one where the workbook was last saved,
> > NOT the folder based on the value in the cell.
> >
> > The value in the folder cell is valid, as I don't get an error message at
> > the CHDIR command - it just isn't reflected in the SaveAs dialog box.
> >
> > Also, I don't have any idea yet as to how to put the user-amendable value in
> > the File Name field yet.
> >
> >
> > Here's what I have so far:
> >
> >
> > Sub AATest()
> >
> > Dim DropDownsSheet As Worksheet
> > Dim DefaultFolderCell As Range
> > Dim DefaultFolderValue As String
> >
> > Set DropDownsSheet = ActiveWorkbook.Worksheets("Dropdowns")
> > Set DefaultFolderCell = DropDownsSheet.Range("DefaultFolder")
> > DefaultFolderValue = DefaultFolderCell.Value
> >
> > MsgBox (DefaultFolderValue)
> > ChDir DefaultFolderValue
> > Application.Dialogs(xlDialogSaveAs).Show
> > End Sub
> >
> > Thanks in advance for your help.
> >
> > Regards
> >
> > Pete

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2007/Vista 64-bit: missing save dialog, cannot save Matthias Schoener Microsoft Excel Discussion 3 10th Feb 2008 07:29 PM
Save File Dialog question Elmo Watson Microsoft Dot NET Framework Forms 1 16th Apr 2007 01:38 PM
Open/Save Dialog question =?Utf-8?B?WmVyZXR1bDE=?= Windows XP General 9 16th Mar 2005 06:48 AM
Re: Question Re: "Save As" dialog box... (-: Jake Marx Microsoft Excel Programming 1 5th May 2004 11:36 PM
Re: Question Re: "Save As" dialog box... (-: Tom Ogilvy Microsoft Excel Programming 0 4th May 2004 07:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:28 AM.