Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default 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
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
Windows XP default path for temp file FCWL Excel Programming 0 September 25th 04 03:45 AM
change default file path in Save As dialog box charles[_2_] Excel Programming 3 August 6th 04 03:03 AM
Applicaition Default File Path Greg Bloom Excel Programming 2 July 12th 04 06:37 PM
Default File Path papou[_9_] Excel Programming 0 July 8th 04 02:49 PM
Default File Path Tom Ogilvy Excel Programming 0 July 8th 04 02:38 PM


All times are GMT +1. The time now is 05:36 AM.

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"