Modules & VBA :: Creating EXE Or BATCH File That Executes Specific Excel Macro?

Jan 27, 2015

Is there a way to create some sort of an EXE or BATCH file in any Windows Explorer folder, that executes me a specific Excel Macro?

My problem is that I got several files split up by Departments, updated every day.

So far I have to open each file and update the format.

It would make my life much more easier if I could just run a file that opens each file and applies a format to them.

View Replies


ADVERTISEMENT

Modules & VBA :: Creating A Batch File To Open Up Another Database

Mar 11, 2015

I want to create a batch file that will be used in a RunApp macro command to open up another database.

View 2 Replies View Related

Creating Batch File Running Access Query?

Dec 20, 2012

I am creating a batch in an Access Query to decompress files that come in from an FTP site. When I right click on the query and export it to a TXT file I get all the line items of the that I want without the header of the query field name. When I run the following command;

DoCmd.TransferText acExportDelim, "Decompress2 Specification", "qry_FileNameChange2", "J:operationsDecompress2.txt", True

(Where "Decompress2 Specification" is the name of the Spec)

I get the name of the field as the first line item and then all the line items I am looking for. I use the same Spec when I manually run it or when I run it from the code. how I can get rid of the first line item when I run it from the code?

I run a batch file to change the txt extension to bat.

View 1 Replies View Related

Modules & VBA :: Export Query Results To Excel With Specific File Name?

Jul 8, 2014

I have a form with a list of names. When a specific name is selected from the list, a button is clicked and a query is run with the specific name as the criteria/filter.

I've written code to export these same query results to an Excel sheet, and I want the Excel file name saved with the name selected in the form.

Below is the code that I've written that doesn't work.

Code:

Dim strFileName As String

strFileName = SelectedItems(Me.lstName)

DoCmd.OutputTo acOutputQuery, "qryFocal_Sheet", acFormatXLS, "C:JRSWorkEquityFY2015" & strFileName & ".xls"

View 7 Replies View Related

Modules & VBA :: Run A Query And Export To Specific Folder As Excel File

Oct 13, 2014

In VBA I have set a timer on a form to run a query and export to a specific folder as an excel file.

If I open the database as 'File Open' and open the form and let the timer run it exports perfectly.

As soon as I put the database into runtime - the Timer code kicks in and starts running but as soon as it hits the export line. It stops and then does nothing

I have tried several combinations of either:

- docmd.runsavedimportexport "Query"
- docmd.outputTo acquery etc ...

View 3 Replies View Related

Modules & VBA :: Export To Specific Sheet In Template Excel File

Feb 11, 2015

So I press a button on my Form1 and my tbl_customers table is exported onto a specific sheet in a templated Excel file "customer-template" that I have created.

This file has formulas on another sheet that based on the imported data.

The file is then saved to a specific location C:AccessCustomersHistory with the file name based on a date that was criteria from my original form E.g. "customers 11-02-15"

View 3 Replies View Related

Modules & VBA :: Creating Opening And Put Excel File In Folder

Oct 21, 2013

I have a macro in access that will create a folder and create a word doc in the folder with the name of the folder. I would like to add to the same folder an excel file. The excel file is in a folder and needs to be copied every time in a new folder when created. where to add the excel file from the below folder:

C:Excel CopyCombine_PDF.xls

this is the macro:

Code:

Private Sub Command22_Click() 'this will register the letter and create folder, word doc and open all
Me.[DateRegistered] = Date
Me.[PersonRegister] = Environ("Username")
Me.Refresh

[code]....

View 2 Replies View Related

Modules & VBA :: Copy Excel File Or A Table In Access To Specific Location On FTP Server

Jul 11, 2013

I need some simple code that will copy an Excel file or a table in Access to a specific location on an FTP server. I would think this would be a very simple task, but I have yet to find any sample code that is *simple*. I have seen lots of code that requires downloading this dll or that mda, but the examples don't work. There must be something built into MS Access 2010 that will allow a file to be uploaded to an FTP site.

All the variables are known:

The FTP location (it never changes)
The FTP Username and Password (they never change)
The destination folder on the FTP site (it never changes)
The File type (it never changes)
The File name (available from the form in Access from which this will be executed)

I can either produce an output file, then copy it to the FTP site, or I can export the table directly to the FTP site with the file name for that day.

This seems to be a very simple task with no simple solution. Currently I am using an FTP app to get the file to the FTP site, but I would like to automate this. The process that creates the output file is already automated, so I would just like to add this to the existing code as its own module.

I'm looking for a simple command on the idea of:

DoCmd.FTPFile, acExel, TableName, FTPFilePath, FTPFileName, Username, Password, acUpload

just made all that above up and none of it is a real function/command in VBA, but is just the kind of thing I'm looking for.

I would think that since I can download and XML file from an FTP site that it should be child's play to upload a simple file to an FTP site, but I can't figure it out.

View 8 Replies View Related

Modules & VBA :: Backup Backend Using Batch File?

Aug 14, 2014

I've created some code to make a backup of my database backend. I've tested it and it seems to work fine, I just have some questions about it's use. Here's the code:

Code:
Public Sub backupBackend()
Dim TestFile As String
Dim strReplFile As String
Dim copyFromLocation As String
Dim copyToLocation As String
copyFromLocation = "S:Trust 2 AnalysisData"

[code]....

It will be triggered by a button push. It creates a batch file to do the copy operation and then delete itself.

In an ideal world I would schedule the backup at a safe time through the Windows scheduler, but our IT department won't allow me to do so.

The concern I have is that we could potentially press the backup button while a user is performing an action that writes/modifies data. If this were to happen would my backup potentially contain corrupted data?

If so, is the workaround to simply press the backup button when nobody is using the database?

View 3 Replies View Related

Modules & VBA :: Export To Excel And Call Macro From Other Excel?

Aug 25, 2013

i want to export a table to excel , open this file and execute a macro from another file.

the code i have now is :

Code:
DoCmd.OpenTable "Overzichtaanwezigheid", acViewNormal
DoCmd.RunCommand acCmdExportExcel
DoCmd.Close acTable, "Overzichtaanwezigheid"
Dim XL As Object
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open ("C:UsersErwinDocumentsOverzichtaanwezigheid.xlsx")
XL.Visible = True
XL.Run "d: est.xlsm!Macro3"

Opening the excel file goes ok, running the macro however not.

View 1 Replies View Related

Modules & VBA :: Run A Macro At Specific Time Of Each Day

Dec 9, 2013

I would like to have a macro run at a set time each day. I hoped to use .ontime but apparently that doesn't exist in access.

The macro must run at 10:00am each day, the db will be open from 8:30am until 16:30pm so no problem from that point of view +/- a few mins when the staff arrive.

View 4 Replies View Related

Modules & VBA :: How To Print Specific Report With PrintObject In Macro

Feb 13, 2015

Actually I need to select printer before printing report. That's why I need to call printer dialog to select printer using "PrintObject" in macro. But it's print the form not report. I need to print a specific report.

View 1 Replies View Related

Need Help Creating Table From Excel File

Nov 20, 2006

I am stuck with a problem where I need to create a new table from an excel file. In detail my problem is;
The excel file contains an order from a customer, like below,
BOM Component Qty
123 abc 2
123 def 2
234 ert 1
234 qwe 1
234 uio 1

I need to create a table from this data like;
Qty Partno
1 123
4 abc
4 def
1 234
2 ert
2 qwe
2 uio

NB! In reality the components are numbers not letters.
The qty for BOM is always 1 and the component 2xqty.

It is important that the BOM number is listed first and thereafter its components.

So I need to somehow associate the BOM number with its components and list them together as a group.
I just cannot figure out how to do this.

ANy help is greatly appreciated.

View 1 Replies View Related

Import A Text File Weekly Within A Batch File

Jan 30, 2006

hello everyone, i really need some detailed help as the deadline is approaching and I need to find a solution for this. Any help would be greatly appreciated

I currently have a batch file that ftps a text file from a Red Hat Linux Server to my W2k C:. I would like to make another command in the batch file that imports this text file into an existing access table. I would like the text file to repopulate the table everytime it is imported. I do not want the data added on to the existing data in the table.

Thank you for your time and insight.!!!:)

View 3 Replies View Related

General :: Batch File To Check (version) Of A File?

Aug 28, 2012

I use a batch file to distribute the front end of a database application. Currently, everytime the user clicks the shortcut on her desktop, the batch file executes and copies the front end from a network location to user's local machine. The FE is updated like every couple of days. The users run the database more frequently.

I would like to modify the batch file so that it checks some attribute of the FE file to decide whether it needs to be updated. I can't rely on file size, since the FE includes temporary tables. I essentially need something like the "tag" property of form controls, only for files. It would be ideal if it was me who sets this property, like "version number". Except it has read without opening the file itself.

View 14 Replies View Related

Creating Access Table Linked To Excel File

May 22, 2013

I am trying to create an access table linked to an excel file.

The excel file has 256,000 kb, 15 columns, 6,400 rows.

When I go to CREATE, DESIGN VIEW in access and try to create the new linked access table i get this message -

"MICROSOFT ACCESS HAS ENCOUNTERED A PROBLEM AND NEEDS TO CLOSE". I click on Ok and then it says "REPAIR MY OPEN DATABASE AND RESTART MS ACCESS".

I click on OK and then save the back up file. The file disappears. I start over again and the same process starts again and again...

View 14 Replies View Related

Modules & VBA :: To Check If Excel Files Are Updated Today Then Run A Macro

Jun 26, 2015

I have a database which I've creating but now want to make others available to update - in the past this has not gone well! The database uses data from two excel sheets and the problem has been people do not always check if these have been updated today before running and therefore the database gets loaded with old data.I have found code that will check and display a message showing datelastmodified for a file but what i'm trying to find is code which will check both files' datelast modified, if they are modified today then run the update macro, if one or both are not modified today, then to display a message saying that the excel is not updated.

View 7 Replies View Related

Modules & VBA :: Determine Excel File Type Without Opening The File?

Aug 14, 2015

Question: Is it possible, using VBA, to determine the actual Excel file type without opening the file?

I receive data files from other departments. Seems like every time someone changes their download structure, I end up with file types that do not match the download extension (example: xlm file with a xls extension). The files can't even be opened because of this. I think I can fix it if I could figure out how to determine what the file type really is.

I'm using Office 2010.

View 3 Replies View Related

Normalization For Creating Batch Process Records

Nov 28, 2011

I am just getting started creation a new database for batch process production records that will be filled completed in the field real time. I had started out creating a table that had fields for each step of the process. Such as:

[Batch number]
[Equipment] (lookup)
[Process] (lookup)
[Step 1 start time]
[Step 1 comments]
[Step 2 Start time]
[Step 2 comments]
[Step 3 start time]
[Step 3 comments]

I have seperate tables for listing equipment, Processes and standard times for each step of the process. I realize that another way of doing it would be to create another table with a list of the process steps and then my table would look somethink like this.

[Batch number]
[Equipment] (Lookup)
[Process] (lookup)
[Step] (Lookup)
[Start time]

The problem is, I want a form (batchsheet) that already has all of the steps listed for the data entry person and simply a blank for them to enter what time they completed each step. I dont want the client to have to select a [step].

View 1 Replies View Related

Batch File

Jan 24, 2006

I need a batch file that will ask a question :

enter 1 for windows 2000
enter 2 for windows XP

Depending on what the user entered, there will be a copy command.

example :

If answer = 1 then
copy command
If answer = 2 then
a different copy command.

Any help will be appreciated.

View 2 Replies View Related

Batch File For Current Fe

Jun 13, 2005

Could someone please tell me if this is an appropriate way to ensure that all of my users open the most current version of my database each time?

I am not using workgroup security(not needed), and have the be and fe on the network drive. Right now everyone has their own copy of the fe so everytime I make a change they get a new copy emailed to them. I would like to use a batch file instead. This works but want to make sure that I am doing it correctly if I just send everyone this batch file to put on their desktop (CostSavings.bat)

@echo off

if not exist "C:Program FilesMicrosoft OfficeOFFICEMSACCESS.EXE" goto Access11

"C:Program FilesMicrosoft OfficeOFFICEMSACCESS.EXE" "V:ProjectMaterialsPurchSQECost SavingsCostSavings2005.mdb"
goto end

:Access11
"C:Program FilesMicrosoft OfficeOFFICE11MSACCESS.EXE" "V:ProjectMaterialsPurchSQECost SavingsCostSavings2005.mdb"
goto end

:end
rem pause
cls
exit

Any thoughts/suggestions would be appreciated.

Thanks,

Toni

View 2 Replies View Related

Batch File Issue

Jun 20, 2005

I am trying to automatically update a front end with a batch file. I have searched and found a great solution :D but I am having one issue :confused: .

The batch file runs great . . . goes to the network drive; compares the version;deletes the old front end on my system and replaces it; opens access with the new version.

The issue is that is keeps the old version open. I see on some posts that some of you did this successfully but nobody went into that detail. I have tried multiple things but still can't get it. :D

Thanks

View 1 Replies View Related

Batch File To Start DB

Nov 10, 2005

Hi

I want to use a batch file to start the DB. This will check if the Front End is on the users machine and if not copy it over.

It will then check what version of Access they are running and use the appropriate shortcut to open the Database.

This all works fine except that the Batch File does not close down until the Database is closed. Is there anyway to close the Batch File automatically while the database is running?

The Batch file I am using is

@echo off
rem *************************************
rem ** Batch file to copy FE **
rem *************************************

rem ** Copy Database **

if not exist "c:DB" md "c:DB"
if not exist "c:DBFE.mdb" copy "NetworkPathFE.mdb" "c:DBFE.mdb"
if exist "C:Program FilesMicrosoft OfficeOffice10MSACCESS.EXE" goto Office10
if exist "C:Program FilesMicrosoft OfficeOffice11MSACCESS.EXE" goto Office11
if exist "C:Program FilesMicrosoft OfficeOfficeMSACCESS.EXE" goto Office

:Office10
"C:Program FilesMicrosoft OfficeOffice10MSACCESS.EXE" "c:DBFE.mdb" /WRKGRP "NetworkPathSecured.mdw"
goto End

:Office11
"C:Program FilesMicrosoft OfficeOffice11MSACCESS.EXE" "c:DBFE.mdb" /WRKGRP "NetworkPathSecured.mdw"
goto End

:Office
"C:Program FilesMicrosoft OfficeOfficeMSACCESS.EXE" "c:DBFE.mdb" /WRKGRP "NetworkPathSecured.mdw"
goto End

:End
Exit

Any ideas?

JC

View 4 Replies View Related

Modules & VBA :: Specific Fields From Access To Excel

Apr 15, 2015

VBA for a click button that extracts specific fields in an Access DB in to an Excel spread sheet.

View 9 Replies View Related

Modules & VBA :: Import Specific Worksheet From Excel

Aug 11, 2015

I am new to MS Access and have been trying to use VBA to import a specific worksheet called "Access" in an Excel file (from about 400 users) into a single table. I want the code to search through one folder and import the "Access" worksheet in each Excel workbook within that folder. Each user has the same worksheet name. Here's my problem. I got this VBA code from: AccessMVP where KDSnell gave examples of how to import Excel worksheets into MS Access Tables.

Sub ImportExcel()
Dim strPathFile As String, strFile As String, strPath As String
Dim blnHasFieldNames As Boolean
Dim intWorksheets As Integer
' Replace 3 with the number of worksheets to be imported
' from each EXCEL file

[Code] ....

When I execute the code. Nothing happens. I go to the table and find nothing....or I get Runtime error 3011, where MS Access can not find the object "Access". Also, is it possible to update the table without duplicating records?

I'm using Excel 2010 and Access 2010.

View 5 Replies View Related

Batch File Datbase Backups

Feb 7, 2006

hi all,

i want to create a batch file that basically backs up the database file i want into a folder as follows

x:ackupsdatabase020206db.mdb

i know that the command to create the folder is mkdir but i want to know how to integrate the data into the folder name so that this batch file can be run in windows scheduler and i dont have to worry about it overwriting the existing folder name.

any ideas?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved