Topics Search

VBA and command line

VBA and command line
Views: 50
I am trying to run a powershell file from command line. What I need to do in command line is

cd D:\Scripts\WTV-MetaRenamer\
powershell -command "& 'D:\Scripts\WTV-MetaRenamer\wtv-metarenamer.ps1' "

I can figure out how to get this done in vba. I have search everything and tried shell and stuff, but I cant figure out how to run one line then the next
Sponsored Links:

Similar posts...


Pass command line parameters

Pass command line parameters Icon
How can I pass a command line parameter to a function in a VBA module. I want to pass the name of a database to an import database function written in VBA

reg.exe through command prompt and Shell in VBA cause different behavior

reg.exe through command prompt and Shell in VBA cause different behavior Icon
I'm running Access 2010 32bit on Win7 x64 and was mostly aware of what it means in relation to registry and how it behaves with redirection, but was not aware it will cause discrepancy inhow included Windows libraries perform.

Here's description. Windows (from XP onward I think) include one brilliant little command line app reg.exe which enables tons of tricky operations with Registry in very simple manner. For example, I need to copy a key with subkeys and values to new location (from HKLM to HKCU).

This little app does it in a single line command! and can of course be used from VBA through Shell command.

However, same line run from command prompt and through Shell function copies different keys. The one through command prompt copies asked key, the one through Shell function copies redirected key (from Wow6432Node, instead from HKLM\Software).

Of course, I don't want that! I know everything will be fine on x32 Windows, but on x64 Windows it simply reads wrongkey.

And that's exactly what I tried to avoid by this approach! Is there a way to run reg.exe from VBA as if it's run from command prompt, or force it not to redirect?

multi lined shell command?

multi lined shell command? Icon
I have some VBA in a MS Access module that properly and successfully executes a shell command that executes a batch file in the following manner:Shell("C:\runthisfile.bat")I am trying to actually place the contents of the batch file into the module. The problem is that the batch file is many lines. How would I write that?

Shell("ftp.exe -s:%0)
Shell("open myftpserver")
probably 100 lines with each line being a separate shell command, but that doesn't work and neither does
Shell(" all lines")Is it possible to essentially shell many lines at the same time thereby making it possible to take say 100 lines resident in a batch file and just placing them all in the VBA module with shell command(s) instead of calling out the batch file that resides outside of the ms access file? It seems that I can only do single line shell commands?

retrieving data from command line program

retrieving data from command line program Icon
I'm a long time reader but first time poster.

I have a command line program that I need to call (with parameters) in access. The program prints a line out to the command line and then quits - I need to somehow get the data it prints into access.

Anybody got any ideas/experience in this

Command button-Build Query/Report

Command button-Build Query/Report Icon
with VBA, Access 2003. Basically I have a Database that track temporary employees: Names, Agency, line employee occupies, rate of pay and hours worked/week.

I want to create a command button that when I click on it, a Query or Report will be created after selecting "Agency" and "Week", and writing a name for the Query/Report, showing the following:

Temps who work for the agency
Line occupied
Hours worked that week.

I know almost nothing of VBA, if someone would be able to give me some "general" code from which I can start figure out

Format Graph Using Vba

Format Graph Using Vba Icon
Is there a method to format a graph using vba?

I need to create a line graph and, using VBA, would like to:
* set line colour
* set line thickness

Bearing in mind that the graph will have numerous lines

Query - aggregate function

Query - aggregate function Icon
This table is a bit more complicated than it looks because more or less every line is generated by a different data source. I have been trying for some time to work out a module which would calculate a percentage of Line 7 against Line 1, which would then populate Line 9.

For example field GCC in Line 9 should = (26/46)*100 to give me the % I require, however, to date I have singularly failed to work out either how to do this in VBA using the data source (its the same for both lines 1 and 7 in this case) or by doing an update query which keeps on giving me aggregate errors.

Doing this by VBA would be much easier for me - I'm dealing with 000s of potential lines across the tables I want to calculate, and having to write 3/4 queries to get to each line's result is going to be extremely onerous.

Command-line arguments for Access

Command-line arguments for Access Icon
I'd like to know if there is a Microsoft Access command-line argument that would allow me to compact the database upon opening.

Access Your Database From the Command Line

Access Your Database From the Command Line Icon
Building a Web site for personal use or for a small company is easy if you are familiar with the operating systems, servers and software programs that you need to put the Web site to work. Command lines and queries are quite simple to manage. Read on to learn how to access your database from the command line.

How to export MDB file in the command line in Windows?

How to export MDB file in the command line in Windows? Icon
I can export Tables from Microsoft Access MDB files using the export option, but my users have many tables to export, and it's cumbersome for them to do so.

Is it possible through Windows in the command line, to output an MDB file to a text file? If it's possible, then, I can put that command in a batch program and allow the users to easily do the export for many MDB files.

For example, at the command line:

MDBTOOLS <filename.mdb> <outputfile.txt&gt