Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
What is the simplest IPC from Excel VBA to a .NET app?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Brock  
View profile  
 More options Nov 8 2009, 10:02 am
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework.remoting, microsoft.public.dotnet.framework.windowsforms, microsoft.public.dotnet.framework.interop, microsoft.public.excel.misc
From: jbr...@panix.com (John Brock)
Date: Sun, 8 Nov 2009 02:02:27 +0000 (UTC)
Local: Sun, Nov 8 2009 10:02 am
Subject: What is the simplest IPC from Excel VBA to a .NET app?
What is the simplest way for VBA code (in Excel) to send some sort
of signal to a .NET process and tell it to do something?  The VBA
code knows the task ID of the .NET process, because it started that
process (a Windows Forms app) using Shell().  It isn't necessary
to pass any information either way (although that wouldn't hurt);
all that is needed is a way to poke at the .NET process so that it
wakes up and looks for an instruction file that has just been
written by Excel.

Right now the .NET process is polling the disk, looking for new
instruction files.  This actually works fine, but since there can
be long intervals between new instruction files, it would be better
if there were some way for Excel to notify the .NET process directly
when a new file is written.  I'm sure there's a way to do this
using sockets and threads, but I'd like to add as little complexity
as possible, so if anyone knows a simpler way I hope you will let
me know about it.
--
John Brock
jbr...@panix.com


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Family Tree Mike  
View profile  
 More options Nov 8 2009, 10:15 am
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework.remoting, microsoft.public.dotnet.framework.windowsforms, microsoft.public.dotnet.framework.interop, microsoft.public.excel.misc
From: Family Tree Mike <FamilyTreeM...@ThisOldHouse.com>
Date: Sat, 07 Nov 2009 21:15:22 -0500
Local: Sun, Nov 8 2009 10:15 am
Subject: Re: What is the simplest IPC from Excel VBA to a .NET app?

How is the .Net process polling, currently?  If you are just testing for
a file existence, then I think you should try FileSystemWatcher on the
.net side.

I'm sure there is a way for Excel to signal the external app, but the
process sound more or less independent.

--
Mike


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Brock  
View profile  
 More options Nov 9 2009, 6:02 am
Newsgroups: microsoft.public.dotnet.general, microsoft.public.dotnet.framework.remoting, microsoft.public.dotnet.framework.windowsforms, microsoft.public.dotnet.framework.interop, microsoft.public.excel.misc
From: jbr...@panix.com (John Brock)
Date: Sun, 8 Nov 2009 22:02:01 +0000 (UTC)
Local: Mon, Nov 9 2009 6:02 am
Subject: Re: What is the simplest IPC from Excel VBA to a .NET app?
In article <#KFrRlBYKHA....@TK2MSFTNGP05.phx.gbl>,
Family Tree Mike  <FamilyTreeM...@ThisOldHouse.com> wrote:

Definitely an improvement!  (And it probably would have taken me
hours of plowing through the .NET documentation before I stumbled
across that class, so thanks!).

Unfortunately the sequence of events the .NET process receives from
FileSystemWatcher varies -- in a not always intuitive way --
depending to how the watched file is updated.  (E.g., if I create
the file using "Save As..." in Notepad the sequence is Created,
Deleted, Created, Changed, Changed).  This makes it difficult for
me to determine in a completely general way when the file is ready
to be read.

I can get around this of course by writing the file under a different
name and then renaming it.  I'm still hoping though to find some
easy way to use the task ID to directly signal the .NET process
from Excel, or even pass it a string.  But if I can't then
FileSystemWatcher it is.
--
John Brock
jbr...@panix.com


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google