Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Calling Excel macro remotely?

I have a task I would like to automate. It only takes a few minutes to run,
but it has to run on one particular machine on our network (hardware key),
and babysitting it through the process takes longer than the process itself.
The data generated is then used on a different machine, so there's some
walking back and forth.

What I would like to do is simply call the macro from the main spreadsheet
on my machine. Is there any way to do this? I suppose I could use an autoexec
macro in the spreadsheet, but that seems a little less than perfect (it would
be nice to be able to call one of n different versions of the macro, some
only update a few items from the whole set). I don't see a "run this macro"
command-line switch though.

Also, what is the best way to spool it? I have seen code that will run a
file on the command line, but it seems that it returns before the file has
completed running. Since I'm waiting on the data being generated before I can
continue, I'd need to pause until it completed.
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Calling Excel macro remotely?

if you can open the file on your machine, you should be
able to run the macro from your machine. i fail to
understand why it has to run on a perticular machine.
otherwise you are looking at some heavy duty code or 3
party software like lotus notes. but that would still put
the running of the macro on your machine. excel cannot
send a command to another machine and tell IT to run a
macro.

-----Original Message-----
I have a task I would like to automate. It only takes a

few minutes to run,
but it has to run on one particular machine on our

network (hardware key),
and babysitting it through the process takes longer than

the process itself.
The data generated is then used on a different machine,

so there's some
walking back and forth.

What I would like to do is simply call the macro from the

main spreadsheet
on my machine. Is there any way to do this? I suppose I

could use an autoexec
macro in the spreadsheet, but that seems a little less

than perfect (it would
be nice to be able to call one of n different versions of

the macro, some
only update a few items from the whole set). I don't see

a "run this macro"
command-line switch though.

Also, what is the best way to spool it? I have seen code

that will run a
file on the command line, but it seems that it returns

before the file has
completed running. Since I'm waiting on the data being

generated before I can
continue, I'd need to pause until it completed.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Calling Excel macro remotely?

" wrote:

if you can open the file on your machine, you should be
able to run the macro from your machine. i fail to
understand why it has to run on a perticular machine.


As I stated, the code in question is protected by a hardware key on that
machine. It will not run on any other machine. However that code represents
perhaps 2% of the overall task, and that machine is very slow. Therefore I
would like to run that 2% on that machine, and the other 98% on my own.

otherwise you are looking at some heavy duty code or 3
party software like lotus notes. but that would still put
the running of the macro on your machine. excel cannot
send a command to another machine and tell IT to run a
macro.


Which is why I wrote my question.

Maury
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calling Excel macro remotely?

I wouldn't give up yet. There are such things as NetDDE and DCOM that
support this I believe. I don't know anything about them, but they may
provide the facilities you need. They both have to do with applications
that support Automation. However, if the application on the other machine
doesn't support COM, can you start it from that machine using excel. Then
perhaps you could communicate with Excel to start the application. As far
as using the file produced, your code can check the status of the file,
start the application, then periodically check the file to see if a new one
has been produced.

Look at CreateObject in VBA help in xl2000 or later. Note that the last
argument is ServerName.

CreateObject(class,[servername])


--
Regards,
Tom Ogilvy

"Maury Markowitz" wrote in
message ...
" wrote:

if you can open the file on your machine, you should be
able to run the macro from your machine. i fail to
understand why it has to run on a perticular machine.


As I stated, the code in question is protected by a hardware key on that
machine. It will not run on any other machine. However that code

represents
perhaps 2% of the overall task, and that machine is very slow. Therefore I
would like to run that 2% on that machine, and the other 98% on my own.

otherwise you are looking at some heavy duty code or 3
party software like lotus notes. but that would still put
the running of the macro on your machine. excel cannot
send a command to another machine and tell IT to run a
macro.


Which is why I wrote my question.

Maury



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Calling Excel macro remotely?

"Tom Ogilvy" wrote:

Look at CreateObject in VBA help in xl2000 or later. Note that the last
argument is ServerName.


Thanks Tom, it looks like this is what I need. I'm having some problems
trying to figure out what security settings are needed to allow it to work
(right now everything gives me a permissions error) but other than that it
seems simple enough.

Maury


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calling Excel macro remotely?

I have never used it or played with it - so I can't be of much help there.
Sorry.

You might search on MSDN to see if there is any information

http://msdn.microsoft.com


--
Regards,
Tom Ogilvy

"Maury Markowitz" wrote in
message ...
"Tom Ogilvy" wrote:

Look at CreateObject in VBA help in xl2000 or later. Note that the last
argument is ServerName.


Thanks Tom, it looks like this is what I need. I'm having some problems
trying to figure out what security settings are needed to allow it to work
(right now everything gives me a permissions error) but other than that it
seems simple enough.

Maury



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Calling Excel macro remotely?


"Tom Ogilvy" wrote in message
...
I wouldn't give up yet. There are such things as NetDDE and DCOM that
support this I believe. I don't know anything about them, but they may
provide the facilities you need. They both have to do with applications
that support Automation. However, if the application on the other machine
doesn't support COM, can you start it from that machine using excel. Then
perhaps you could communicate with Excel to start the application. As far
as using the file produced, your code can check the status of the file,
start the application, then periodically check the file to see if a new

one
has been produced.

Look at CreateObject in VBA help in xl2000 or later. Note that the last
argument is ServerName.

CreateObject(class,[servername])



DCOM should definitely be able to do the trick. I have only done this from
C++. I shall try to find relevant articles to help you get started.

/ Fredrik



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling excel macro TommyBoy Excel Programming 0 August 12th 04 10:25 PM
calling macro in excel from VB program Fung Excel Programming 1 July 21st 04 01:54 PM
Calling Excel Macro From Vc++ via DDE hari Excel Programming 0 July 6th 04 12:50 PM
Opening Excel remotely ibeetb Excel Programming 1 April 15th 04 03:04 PM
calling a dll from excel macro Stefan[_4_] Excel Programming 1 December 12th 03 12:16 AM


All times are GMT +1. The time now is 04:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"