2003 version of excel has no path default setup for importing dat.

G

Guest

2000 version of Excel had a default path for importing data & open files &
xml but
the 2003 version of excel does not go to the default path when importing data.
it always goes to my data subdirectory under C: drive instead of the default
path
that is set up under tools/general. Could the 2003 version be set up so
importing
external data defaults to the default working folder??????
Thanks for you help.
Gene Rose


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...5b5160b&dg=microsoft.public.excel.programming
 
G

Guest

BEAN,

Are you wanting to open files where the file name(s) change? If not you can
hard code the path\file into the macro. If the name of the file you're
importing Does change, you can code in a way to have a file browser window
open so you can file the file that way and the path will be saved as part of
the variable. I will also include the coding to strip the path out if you
need to use just the file name without the path to it. I use this method to
save the file once I'm done with it and to activate the workbook when I need
to without having to make the whole thing one giant macro.
*************************
Public OpenFile
*************************
Sub FindTheFile_Click()
'Open a file browser so the User can find the file and then open the file'
Application.AutomationSecurity = msoAutomationSecurityByUI
FileToOpen = Application _
.GetOpenFilename("Excel Workbooks Files (*.xls), *.xls")
If FileToOpen <> False Then
Workbooks.Open (FileToOpen)
End If
'Strips the file path from the file leaving just the file name for future
use (if you put the "OpenFile" variable in the Public Area)
OpenFile = Right(FileToOpen, Len(FileToOpen) - InStrRev(FileToOpen, "\"))
End Sub

This routine actually opens the file as a separate file but can be modified
to import the data from the opened file instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top