473,499 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run a batch file to exec a macro without having to re-open a new instance of access

1 New Member
I am trying to execute a macro in my access database from a windows scheduler task but instead of the batch script re-opening access I need it to run on an already open database. The reason for this is we are having a problem with our linked tables whereby everything we re-open the database we are requiring to re-authenticate our linked tables via a polyp menu.
Jun 15 '13 #1
1 4332
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
If you use a wscript file you can use code like:
Expand|Select|Wrap|Line Numbers
  1. strPath="C:\Databases\YourAccessDatabase.accdb"
  2. Set AccessApp=GetObject(strPath).Application
  3. AccessApp.Run "NameOfProcedure"
  4. set oApp=Nothing
If the app is already open, it will use the active application, and if not, it will open a new instance of access.
Jun 17 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

14
3530
by: Mark C. | last post by:
I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run... in an asp script. Naturally, I can get the script to work from a command...
3
5052
by: Keith Wilby | last post by:
I have some code in my app that updates data by interrogating data from Artemis. It works fine, but I wondered if I'd be able to write a batch file which, at a predetermined time each day, would...
4
47418
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
4
26780
by: CliffKing | last post by:
I am trying to use Windows Task Scheduler to run a batch file for an already open MS Access database. Below is the syntax to the batch file: Batch file: DailySalesExport.bat REM This runs the...
13
5405
by: MLH | last post by:
I have a batch file named GetConf.bat. It contains a line like this: ipconfig /all >c:\MyAppDir\IPdata.txt I believe I could run the line with something like ShellWait by Terry Kreft. Any...
1
1606
by: Dieter Vanderelst | last post by:
Dear all, Could anybody tell me whether there are ways to use an existing DLL file in Python without having access to the source code? I'm trying to find a way to use the image filters...
7
21576
by: rhjaisingh | last post by:
Folks, I need to create a batch file that will do the following - Establish a DB2 instance Connect to a certain database Get data using an sql and output it to a file So, this is what I...
1
8691
by: A_StClaire_ | last post by:
hi everyone, is this possible? I know there are third party tools such as Aspose.Cells for .NET, but do you know of any cost-free alternatives? should mention using OLEDB is not a preferred...
14
12769
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
1
6182
by: 9916404403 | last post by:
How to display PDF file in browser without having any save option using Asp.net my mail id is email removed for security
0
7131
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
7007
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...
1
6894
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
7388
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...
1
4919
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
4600
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...
0
3099
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
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.