Modifying a cell value in Excel through an external app

Started by
2 comments, last by Brain 9 years, 2 months ago

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!

Advertisement

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!

Another option is LinqToExcel

Presents a nice interface for query excel sheets. Really easy to use.

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
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!

This topic is closed to new replies.

Advertisement