Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?()
Is it possible to change this code to show which directory the SAVE.AS should
use asthe default? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?()
Tools -- Options -- General Tab -- Default file location:
The above is the menu option to change the default location. You have to exit MS Excel then reopen it. I don't see any of the code so if it is some VB code then probably use: Sub DefaultLocation() Dim strSaveAs As String strSaveAs = Application.DefaultFilePath MsgBox strSaveAs End Sub "Paul Dennis" wrote: Is it possible to change this code to show which directory the SAVE.AS should use asthe default? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.A
I don't want to change the dafault location for all xls files, just the one
with this button, i.e. they press the button and it shows the save as pop up dafaulting to the directory of my choice, but just for this one xls. The code I'm using is Private Sub SaveForm_Click() Application.ExecuteExcel4Macro ("SAVE.AS?()") End Sub and I want the default location to be "C:\Service Improvement\ToDo" "Mallasch" wrote: Tools -- Options -- General Tab -- Default file location: The above is the menu option to change the default location. You have to exit MS Excel then reopen it. I don't see any of the code so if it is some VB code then probably use: Sub DefaultLocation() Dim strSaveAs As String strSaveAs = Application.DefaultFilePath MsgBox strSaveAs End Sub "Paul Dennis" wrote: Is it possible to change this code to show which directory the SAVE.AS should use asthe default? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.A
This kind of thing works for a mapped drive:
Option Explicit Private Sub SaveForm_Click() Dim CurFolder As String Dim NewFolder As String Dim TestStr As String CurFolder = CurDir NewFolder = "C:\Service Improvement\ToDo" TestStr = "" On Error Resume Next TestStr = Dir(NewFolder & "\nul") On Error GoTo 0 If TestStr = "" Then MsgBox "design error!" Else ChDrive NewFolder ChDir NewFolder End If Application.Dialogs(xlDialogSaveAs).Show ChDrive CurFolder ChDir CurFolder End Sub Paul Dennis wrote: I don't want to change the dafault location for all xls files, just the one with this button, i.e. they press the button and it shows the save as pop up dafaulting to the directory of my choice, but just for this one xls. The code I'm using is Private Sub SaveForm_Click() Application.ExecuteExcel4Macro ("SAVE.AS?()") End Sub and I want the default location to be "C:\Service Improvement\ToDo" "Mallasch" wrote: Tools -- Options -- General Tab -- Default file location: The above is the menu option to change the default location. You have to exit MS Excel then reopen it. I don't see any of the code so if it is some VB code then probably use: Sub DefaultLocation() Dim strSaveAs As String strSaveAs = Application.DefaultFilePath MsgBox strSaveAs End Sub "Paul Dennis" wrote: Is it possible to change this code to show which directory the SAVE.AS should use asthe default? -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.A
thanks - I tried it but it didn't change anything, still pointing to the
current directory. "Dave Peterson" wrote: This kind of thing works for a mapped drive: Option Explicit Private Sub SaveForm_Click() Dim CurFolder As String Dim NewFolder As String Dim TestStr As String CurFolder = CurDir NewFolder = "C:\Service Improvement\ToDo" TestStr = "" On Error Resume Next TestStr = Dir(NewFolder & "\nul") On Error GoTo 0 If TestStr = "" Then MsgBox "design error!" Else ChDrive NewFolder ChDir NewFolder End If Application.Dialogs(xlDialogSaveAs).Show ChDrive CurFolder ChDir CurFolder End Sub Paul Dennis wrote: I don't want to change the dafault location for all xls files, just the one with this button, i.e. they press the button and it shows the save as pop up dafaulting to the directory of my choice, but just for this one xls. The code I'm using is Private Sub SaveForm_Click() Application.ExecuteExcel4Macro ("SAVE.AS?()") End Sub and I want the default location to be "C:\Service Improvement\ToDo" "Mallasch" wrote: Tools -- Options -- General Tab -- Default file location: The above is the menu option to change the default location. You have to exit MS Excel then reopen it. I don't see any of the code so if it is some VB code then probably use: Sub DefaultLocation() Dim strSaveAs As String strSaveAs = Application.DefaultFilePath MsgBox strSaveAs End Sub "Paul Dennis" wrote: Is it possible to change this code to show which directory the SAVE.AS should use asthe default? -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.A
I don't have another guess. It works fine for me.
Paul Dennis wrote: thanks - I tried it but it didn't change anything, still pointing to the current directory. "Dave Peterson" wrote: This kind of thing works for a mapped drive: Option Explicit Private Sub SaveForm_Click() Dim CurFolder As String Dim NewFolder As String Dim TestStr As String CurFolder = CurDir NewFolder = "C:\Service Improvement\ToDo" TestStr = "" On Error Resume Next TestStr = Dir(NewFolder & "\nul") On Error GoTo 0 If TestStr = "" Then MsgBox "design error!" Else ChDrive NewFolder ChDir NewFolder End If Application.Dialogs(xlDialogSaveAs).Show ChDrive CurFolder ChDir CurFolder End Sub Paul Dennis wrote: I don't want to change the dafault location for all xls files, just the one with this button, i.e. they press the button and it shows the save as pop up dafaulting to the directory of my choice, but just for this one xls. The code I'm using is Private Sub SaveForm_Click() Application.ExecuteExcel4Macro ("SAVE.AS?()") End Sub and I want the default location to be "C:\Service Improvement\ToDo" "Mallasch" wrote: Tools -- Options -- General Tab -- Default file location: The above is the menu option to change the default location. You have to exit MS Excel then reopen it. I don't see any of the code so if it is some VB code then probably use: Sub DefaultLocation() Dim strSaveAs As String strSaveAs = Application.DefaultFilePath MsgBox strSaveAs End Sub "Paul Dennis" wrote: Is it possible to change this code to show which directory the SAVE.AS should use asthe default? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot save excel files to a folder on a network | Excel Discussion (Misc queries) | |||
macro save a workbook whilst increasing file no | Excel Worksheet Functions | |||
Save as Msg box | Excel Discussion (Misc queries) | |||
Save as Msg box | Excel Discussion (Misc queries) | |||
Save & Save As features in file menu of Excel | Excel Discussion (Misc queries) |