ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running a macro from a command line (https://www.excelbanter.com/excel-programming/317820-running-macro-command-line.html)

Kelly

Running a macro from a command line
 
Hi all, can anyone tell me if you can referance a xls workbook and run the
macro within form a command line?

I am now using an on Open event so it auto runs when it is open but i was
wondering if I could run it by referencing it?

Kelly

Gord Dibben

Running a macro from a command line
 
Kelly

You cannot run a macro from the command line.

What you're doing with the Auto_Open or Workbook_Open is it.

Gord Dibben Excel MVP

On Thu, 25 Nov 2004 14:22:17 -0800, "Kelly"
wrote:

Hi all, can anyone tell me if you can referance a xls workbook and run the
macro within form a command line?

I am now using an on Open event so it auto runs when it is open but i was
wondering if I could run it by referencing it?

Kelly



IXLINXL

Running a macro from a command line
 
Thanks Gord, Can you suggest a method to open and edit the macro without it
auto-running?

Here's the situation. It is fairly quick code so it is really tough hit
escape quick enough to stop it form running. Also It is digitaly signed so it
never prompts me ands asks if I want to run the macro. this is true even if I
set the security setting sto high.

The only way I have found to open the workbook and edit the macro is to open
excel and remove the athorization of the the digital certificate THEN sdet
security settings to med or high.

There has to be a better way? I read somewhere if you hold the shift button
down while you open the wkbk it will not run the code but this does not work
for me??

Any ideas?

Thanks again,

Kelly

"Gord Dibben" wrote:

Kelly

You cannot run a macro from the command line.

What you're doing with the Auto_Open or Workbook_Open is it.

Gord Dibben Excel MVP

On Thu, 25 Nov 2004 14:22:17 -0800, "Kelly"
wrote:

Hi all, can anyone tell me if you can referance a xls workbook and run the
macro within form a command line?

I am now using an on Open event so it auto runs when it is open but i was
wondering if I could run it by referencing it?

Kelly




Gord Dibben

Running a macro from a command line
 
Kelly

I am surprised to hear the SHIFT key is not working for you.

Open another workbook or start Excel with no workbook and copy this to the
Immediate Window of VBE

Application.EnableEvents = False

Open the other workbook and the workbook_open code won't run.

Do your editing and save/close.

In VBE Immediate Window enter

Application.EnableEvents = True

Gord Dibben Excel MVP

On Fri, 26 Nov 2004 07:21:03 -0800, "IXLINXL"
wrote:

Thanks Gord, Can you suggest a method to open and edit the macro without it
auto-running?

Here's the situation. It is fairly quick code so it is really tough hit
escape quick enough to stop it form running. Also It is digitaly signed so it
never prompts me ands asks if I want to run the macro. this is true even if I
set the security setting sto high.

The only way I have found to open the workbook and edit the macro is to open
excel and remove the athorization of the the digital certificate THEN sdet
security settings to med or high.

There has to be a better way? I read somewhere if you hold the shift button
down while you open the wkbk it will not run the code but this does not work
for me??

Any ideas?

Thanks again,

Kelly

"Gord Dibben" wrote:

Kelly

You cannot run a macro from the command line.

What you're doing with the Auto_Open or Workbook_Open is it.

Gord Dibben Excel MVP

On Thu, 25 Nov 2004 14:22:17 -0800, "Kelly"
wrote:

Hi all, can anyone tell me if you can referance a xls workbook and run the
macro within form a command line?

I am now using an on Open event so it auto runs when it is open but i was
wondering if I could run it by referencing it?

Kelly





IXLINXL

Running a macro from a command line
 
Much Thanks!

"Gord Dibben" wrote:

Kelly

I am surprised to hear the SHIFT key is not working for you.

Open another workbook or start Excel with no workbook and copy this to the
Immediate Window of VBE

Application.EnableEvents = False

Open the other workbook and the workbook_open code won't run.

Do your editing and save/close.

In VBE Immediate Window enter

Application.EnableEvents = True

Gord Dibben Excel MVP

On Fri, 26 Nov 2004 07:21:03 -0800, "IXLINXL"
wrote:

Thanks Gord, Can you suggest a method to open and edit the macro without it
auto-running?

Here's the situation. It is fairly quick code so it is really tough hit
escape quick enough to stop it form running. Also It is digitaly signed so it
never prompts me ands asks if I want to run the macro. this is true even if I
set the security setting sto high.

The only way I have found to open the workbook and edit the macro is to open
excel and remove the athorization of the the digital certificate THEN sdet
security settings to med or high.

There has to be a better way? I read somewhere if you hold the shift button
down while you open the wkbk it will not run the code but this does not work
for me??

Any ideas?

Thanks again,

Kelly

"Gord Dibben" wrote:

Kelly

You cannot run a macro from the command line.

What you're doing with the Auto_Open or Workbook_Open is it.

Gord Dibben Excel MVP

On Thu, 25 Nov 2004 14:22:17 -0800, "Kelly"
wrote:

Hi all, can anyone tell me if you can referance a xls workbook and run the
macro within form a command line?

I am now using an on Open event so it auto runs when it is open but i was
wondering if I could run it by referencing it?

Kelly






All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com