Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default File Path
Hello everyone from the soggy Southeast US.
I have a workbook which contains only a menu form and supporting code. I use that menu to open a new workbook based on a template as well as to open existing workbooks created previously using the same template. When a new workbook is opened I provide a name and the file is supposed to be saved to a fixed directory that I provide. The directory is one of my own creation, exists and is accessible. In fact the code I am currently having problems with worked previously. When the file is saved, it is saved to the "C:\Program Files\Microsoft Office" directory but it is supposed to be saved to the "C:\Datafiles" directory.When the workbook is opened the following code is executed: Application.DefaultFilePath = "C:\TRUSpreadSheet\DataFiles" To be sure the path was being saved correctly I put a temporary field on my form and run the following code during execution of the code to populate the field with the default file path: TextBox1 = Application.DefaultFilePath Then the following code executes: MyFName = fld_FileName & ".xls" Set MyWkb1 = Workbooks.Open (fileName:="C:\TRUSpreadSheet\TRUWt%Conversion.xlt ") MyWkb1.Activate where fld_FileName is a string taken from the user on the data input form. Everything works properly except the location where the field resides and when I attempt to open an existing workbook using the getOpenFilename method it opens the "File Open" dialog box to the "C:\Program Files\Microsoft Office" directory.Again, this is functionally and logically after issuing the "application. Help! What next? Kevin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default File Path
reply form soggy southeast us
I don't know if it will help your situation but you can goto tooloptions click general tab third box from the bottom you can set the default folder. good look. -----Original Message----- Hello everyone from the soggy Southeast US. I have a workbook which contains only a menu form and supporting code. I use that menu to open a new workbook based on a template as well as to open existing workbooks created previously using the same template. When a new workbook is opened I provide a name and the file is supposed to be saved to a fixed directory that I provide. The directory is one of my own creation, exists and is accessible. In fact the code I am currently having problems with worked previously. When the file is saved, it is saved to the "C:\Program Files\Microsoft Office" directory but it is supposed to be saved to the "C:\Datafiles" directory.When the workbook is opened the following code is executed: Application.DefaultFilePath = "C:\TRUSpreadSheet\DataFiles" To be sure the path was being saved correctly I put a temporary field on my form and run the following code during execution of the code to populate the field with the default file path: TextBox1 = Application.DefaultFilePath Then the following code executes: MyFName = fld_FileName & ".xls" Set MyWkb1 = Workbooks.Open (fileName:="C:\TRUSpreadSheet\TRUWt%Conversion.xl t") MyWkb1.Activate where fld_FileName is a string taken from the user on the data input form. Everything works properly except the location where the field resides and when I attempt to open an existing workbook using the getOpenFilename method it opens the "File Open" dialog box to the "C:\Program Files\Microsoft Office" directory.Again, this is functionally and logically after issuing the "application. Help! What next? Kevin . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default File Path
I am setting that value using the command
Application.DefaultFilePath. In fact, according to the test code I inserted, this value is set at the time the I am either saving the new file or retrieving the file name of the existing file. Kevin -----Original Message----- reply form soggy southeast us I don't know if it will help your situation but you can goto tooloptions click general tab third box from the bottom you can set the default folder. good look. -----Original Message----- Hello everyone from the soggy Southeast US. I have a workbook which contains only a menu form and supporting code. I use that menu to open a new workbook based on a template as well as to open existing workbooks created previously using the same template. When a new workbook is opened I provide a name and the file is supposed to be saved to a fixed directory that I provide. The directory is one of my own creation, exists and is accessible. In fact the code I am currently having problems with worked previously. When the file is saved, it is saved to the "C:\Program Files\Microsoft Office" directory but it is supposed to be saved to the "C:\Datafiles" directory.When the workbook is opened the following code is executed: Application.DefaultFilePath = "C:\TRUSpreadSheet\DataFiles" To be sure the path was being saved correctly I put a temporary field on my form and run the following code during execution of the code to populate the field with the default file path: TextBox1 = Application.DefaultFilePath Then the following code executes: MyFName = fld_FileName & ".xls" Set MyWkb1 = Workbooks.Open (fileName:="C:\TRUSpreadSheet\TRUWt%Conversion.x lt") MyWkb1.Activate where fld_FileName is a string taken from the user on the data input form. Everything works properly except the location where the field resides and when I attempt to open an existing workbook using the getOpenFilename method it opens the "File Open" dialog box to the "C:\Program Files\Microsoft Office" directory.Again, this is functionally and logically after issuing the "application. Help! What next? Kevin . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Windows XP default path for temp file | Excel Programming | |||
change default file path in Save As dialog box | Excel Programming | |||
Applicaition Default File Path | Excel Programming | |||
Default File Path | Excel Programming | |||
Default File Path | Excel Programming |