473,408 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Process needs refining,

I have a process that is currently in 4 separate steps that are operated by
individual buttons on a form in Access.

In Access:
Button 1. Select the csv file to open (filename gets stored in text box)
Button 2. Open the csv file in Excel with Access still running in the
background
(in Excel several macros are run to modify csv file so that it only has the
usable data in it, save the file as an xls File, close Excel)
Button 3. Select the file name created above (filename gets stored in text
box)
Button 4. Import the data into Access

I would like to do this in three buttons

Question 1. when I save the csv file to an excel file is there a way to
"capture" the new xls file name and directory and store it into the access
textbox without having to browse for it??

If I can, I can have this all done in three steps instead of having to
select the filename again.

I greatly appreciate your input.
--
Lynn Arlington
Nov 13 '05 #1
2 1298
ly***********@hotmail.com (Lynn A.) wrote in message news:<f0**************************@posting.google. com>...
I have a process that is currently in 4 separate steps that are operated by
individual buttons on a form in Access.

In Access:
Button 1. Select the csv file to open (filename gets stored in text box)
Button 2. Open the csv file in Excel with Access still running in the
background
(in Excel several macros are run to modify csv file so that it only has the
usable data in it, save the file as an xls File, close Excel)
Button 3. Select the file name created above (filename gets stored in text
box)
Button 4. Import the data into Access

I would like to do this in three buttons

Question 1. when I save the csv file to an excel file is there a way to
"capture" the new xls file name and directory and store it into the access
textbox without having to browse for it??

If I can, I can have this all done in three steps instead of having to
select the filename again.

I greatly appreciate your input.


If you stuff the name of the file into a variable, you can just pass
that variable to some other procedure, like fImportFile(strFileName)
or something. Personally, I like getting *all* the information I need
up front, so the user can answer a few questions, click a button and
walk away while the processing is being done. Especially handy when
you have processes that can take quite a while, like importing/parsing
complicated files.

To be a bit more specific - grab the filename using the FileOpen API
from www.mvps.org/access see the first article in the API section.

use fIsAppRunning to determine if Excel is running. If it is and
you're opening macros, you can run them with a command line switch, I
think.
Since you use the FileOpen API, you can just stuff the filename into a
variable and do whatever you want to with it later - use it for
another process, whatever. When you're done, quit Excel, if you want.
Terminate the automation session. (Do it all in code... you never
actually have to see the Excel stuff running at all if you don't
want.)

I think you should be able to do all this with one button... If you
really wanted to, if you want to process multiple Excel files in
succession, you could put them all into one folder, use the BrowseAPI
function from Access Web, and use the Dir() function to loop through
the contents of the folder, processing each one in sequence.

Not nearly as hard as it sounds - just do each thing in a separate
routine and then tie the routines together...

HTH,
Pieter
Nov 13 '05 #2
ly***********@hotmail.com (Lynn A.) wrote in message news:<f0**************************@posting.google. com>...
I have a process that is currently in 4 separate steps that are operated by
individual buttons on a form in Access.

In Access:
Button 1. Select the csv file to open (filename gets stored in text box)
Button 2. Open the csv file in Excel with Access still running in the
background
(in Excel several macros are run to modify csv file so that it only has the
usable data in it, save the file as an xls File, close Excel)
Button 3. Select the file name created above (filename gets stored in text
box)
Button 4. Import the data into Access

I would like to do this in three buttons

Question 1. when I save the csv file to an excel file is there a way to
"capture" the new xls file name and directory and store it into the access
textbox without having to browse for it??

If I can, I can have this all done in three steps instead of having to
select the filename again.

I greatly appreciate your input.


If you stuff the name of the file into a variable, you can just pass
that variable to some other procedure, like fImportFile(strFileName)
or something. Personally, I like getting *all* the information I need
up front, so the user can answer a few questions, click a button and
walk away while the processing is being done. Especially handy when
you have processes that can take quite a while, like importing/parsing
complicated files.

To be a bit more specific - grab the filename using the FileOpen API
from www.mvps.org/access see the first article in the API section.

use fIsAppRunning to determine if Excel is running. If it is and
you're opening macros, you can run them with a command line switch, I
think.
Since you use the FileOpen API, you can just stuff the filename into a
variable and do whatever you want to with it later - use it for
another process, whatever. When you're done, quit Excel, if you want.
Terminate the automation session. (Do it all in code... you never
actually have to see the Excel stuff running at all if you don't
want.)

I think you should be able to do all this with one button... If you
really wanted to, if you want to process multiple Excel files in
succession, you could put them all into one folder, use the BrowseAPI
function from Access Web, and use the Dir() function to loop through
the contents of the folder, processing each one in sequence.

Not nearly as hard as it sounds - just do each thing in a separate
routine and then tie the routines together...

HTH,
Pieter
Nov 13 '05 #3

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

Similar topics

2
by: Fraser Gordon | last post by:
Hello, Hopefully someone can help me out with this issue... I have a python script that needs to run a shell command and be able to react to output from that command as it occurs (as opposed...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
2
by: Carl Gilbert | last post by:
Hi I am trying to get an online gallery (www.ngallery.org - open source) to upload image to a folder. At the moment I am using localhost but plan to move to some web space when I get it all...
6
by: Alexander Widera | last post by:
hello, if i start a program (an exe-file) with Process.Start(...) I don't have the required permissions that the programm needs (i could start the programm but the program needs special rights)....
8
by: Henrik | last post by:
Hi Is there any way to see what the System process is doing? We have developed an application running at a production site to measure and optimize the production. The application needs to be...
9
by: SeC | last post by:
Hi. Is there any way to detect if application is being killed by 'End Process' via Task Manager ?
4
by: garykenneally | last post by:
Hi, Im trying to run a command line application from C# but i having some strange problems with it. Heres the code im using: System.Diagnostics.Process process = new...
32
by: John Wright | last post by:
I have a long process I run that needs to be complete before the user can continue. I can change the cursor to an hourglass, but I want to update the Status Strip on the bottom during the process. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.