Sign in to follow this  
GuyWithBeard

Modifying a cell value in Excel through an external app

Recommended Posts

Hi,

 

I am trying to figure out if I can somehow write a small app to to help me modify some text-based cell data values in Excel. Basically what I want to do is:

 

-Have a certain column with text data in some custom format (eg. json)

-Have an item added to the context menu that appears when right clicking in that column which would open my custom app

-The external app would be given the cell data as a parameter or through a temp file or something

-Excel would wait for the external app to close and would somehow write the new value back into the cell (again. through eg. a temp file)

 

Have anyone does something like this? I am not super proficient with VBA, so the external app would optimally be written in something else, but the menu and app launching as well as the value replacement would have to be VBA I guess (?).

 

Any tips you can give me would be appreciated!

Share this post


Link to post
Share on other sites

Hi.

I actually had to write a program that would automatically generate excel spreadsheets and graphs programmatically and it took forever to track down the documentation needed to do this. Although that doesn't sound like what you are doing it will get you in the right direction.

 

You should start looking into excel interop:

 

https://msdn.microsoft.com/en-us/library/dd264733.aspx

 

This will show you how to create one from a C# program. But you can also use it to modify an existing spreadsheet I believe.

 

I hope this helps!

Share this post


Link to post
Share on other sites
I have a lot of experience of working with Excel.application interop in both c# and php.

Something important to be aware of is that it is about as scalable as a wet toilet roll. In any multi user situation it starts to crack under the stress and can't cope with any reasonable load without starting to use dcom and multiple excel copies on separate machines, basically building an application farm.

The licensing is also shady as technically each person that accesses your app needs a separate license similar to terminal server licensing.

It is also very flimsy via a Web app or via a Windows service, neither of which are supported.

Due to office's interactive nature pop up messages can occur at random even when you configure the object to be silent, so using it in any non interactive role is a risky business.


Good luck!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this