473,473 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Import Excel file which has Dynamic name

Hi All,
I have an Excel file being delivered to a shared drive where I only
have read access on a daily basis.

The files arrive in the following format 'Filename+timestamp.xls'
Example: ThisFile2007-02-01 11.02.00.421.xls

Is there a way a can create some sort of link that matches a pattern?

If file name starts with 'ThisFile'
Import data

Thanks all
Steve

Feb 1 '07 #1
1 4534

Steve wrote:
Hi All,
I have an Excel file being delivered to a shared drive where I only
have read access on a daily basis.

The files arrive in the following format 'Filename+timestamp.xls'
Example: ThisFile2007-02-01 11.02.00.421.xls

Is there a way a can create some sort of link that matches a pattern?

If file name starts with 'ThisFile'
Import data

Thanks all
Steve
Steve,
Not 100% sure about periods in a filename in Windoze, but... the rest
is easy.
If the file is always in the same directory, and always has the same
structure, you can create an import specification by importing the
file manually - do the whole File->Get External Data-dance and
create the import specification.

If the file(s) is/are always in the same directory, you can use Dir()
to loop through the contents and then use TransferSpreadsheet to
import the individual files. Once you get the import spec working,
you're good to go.

I like to use the BrowseFolder API at AccessWeb so the user can
specify where the file(s) are. If you only ever import a single file
at a time, you _can_ use the OpenSaveFile API in the same place.
(www.mvps.org/access) in the APIs section, and even set the filters
etc, but I'm a lazy bugger and like to "tell" Access to look for the
files in the same place (store the path in a table if you want), and
then just process them all. Really handy if you've neglected several.

you can also use the scheduler utility there to run the imports at a
specific time, or you could use the Timer event of a form to execute
the code every fixed number of minutes/hours. Then if your import
spec is working, you won't really have to do anything. The code in an
open (and maybe hidden) form will take care of the work for you.

Feb 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: bry | last post by:
Hi, I'm trying to do a dynamic import of a file that has no problems with it, that is to say I can import it normally, my sys.path is set to the right folder etc. but my dynamic import code is not...
0
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24...
4
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not...
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
10
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in...
1
by: baling | last post by:
Hi.... Hi everybody, i have a code that i make in VBA and know I want to use this code in to VB6. But i don't know how to use that code in to VB 6.0 Please correct this code so i can use it in VB...
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.