Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem setting directory in xlDialogSaveAs
I am trying to set the directory to a default location
with the xlDialogSaveAs command but can't seem to get it to work. Here is my code: MyDate = Replace(FormatDateTime(Now, vbShortDate), "/", "- ") MyPath = "C:\Document and Settings\Administrator\My Documents\Spreadsheets" Application.Dialogs(xlDialogSaveAs).Show (MyPath & "\NewSpreadsheet" & MyDate & ".xls") I have tried changing the directory and setting the lpstrInitialDir neither of which have worked. The save as dialog box keeps reverting to my desktop. Thanks, Jonathan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem setting directory in xlDialogSaveAs
MyDate = _
Replace(FormatDateTime(Now, vbShortDate), "/", "-") MyPath = _ "C:\Document and Settings\Administrator\My Documents\Spreadsheets" Chdrive MyPath ChDir MyPath Application.Dialogs(xlDialogSaveAs).Show _ (MyPath & "\NewSpreadsheet" & MyDate & ".xls") Should work. -- Regards, Tom Ogilvy Jonathan Crow wrote in message ... I am trying to set the directory to a default location with the xlDialogSaveAs command but can't seem to get it to work. Here is my code: MyDate = Replace(FormatDateTime(Now, vbShortDate), "/", "- ") MyPath = "C:\Document and Settings\Administrator\My Documents\Spreadsheets" Application.Dialogs(xlDialogSaveAs).Show (MyPath & "\NewSpreadsheet" & MyDate & ".xls") I have tried changing the directory and setting the lpstrInitialDir neither of which have worked. The save as dialog box keeps reverting to my desktop. Thanks, Jonathan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row height setting problem | Excel Discussion (Misc queries) | |||
Excel setting problem | Excel Discussion (Misc queries) | |||
Change of auto backup directory has created problem | Excel Discussion (Misc queries) | |||
application.dialogs(xlDialogSaveAs) AND CHDIR | Excel Programming | |||
Setting default directory prior to GetOpenFilename | Excel Programming |