The actual task of inserting a new column is fairly trivial. Unfortunately, it's near impossible to ascertain what will be considered an acceptable (useful) answer.
What have you tried and what was the result?
Using the macro-recorder in Excel, we can see that if we right-click on column C then select "Insert", we get the following VBA code:
Sub Macro1()
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub
Searching the Help for "Columns", we find it to be a member of the Worksheet object. The result of a call to the Columns method is a Range.
This range is first specified
Then is selected. Once done, the Insert method is called on the range.
Looking at the Excel help for Range.Insert, we see that it takes two (optional) parameters - Shift and CopyOrigin (both VARIANTs)
We're lazy, so we'll see if it produces the right result without either of the two params. Back to the VBA editor, remove the two params and run the macro. Beautifull! Just the same result (in this case) as it was when we recorded it earlier. So, we'll ditch the params for now (may have to add them again later for situations not imagained yet)
So, armed with this knowledge we're ready to put it into a standalone app.
I don't use C#, so can't guide you on specifics - but this is the process when used from C++ in gcc. Since you're using C#, it will be much simpler and cleaner since you'll be able to Add a Reference to the MS Office COM object (I forget it's name) and just use the objects themselves, without all of the nasty IDispatch gobble-d-gook.
CoInitialize(NULL);
CLSID clsid;
HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);
if(FAILED(hr)) {
MessageBox(NULL, L"CLSIDFromProgID() failed", L"Error", 0x10010);
return -1;
}
IDispatch *pXlApp;
hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pXlApp);
if(FAILED(hr)) {
MessageBox(NULL, L"Excel not registered properly", L"Error", 0x10010);
return -2;
}
{
VARIANT result, var1;
wstring rangeStr;
IDispatch *pRange;
VariantInit(&result);
rangeStr = L"C:C";
var1.bstrVal = SysAllocString(rangeStr.c_str());
var1.vt = VT_BSTR;
AutoWrap(DISPATCH_PROPERTYGET, &result, pXlSheet, L"Range", 1, var1);
pRange = result.pdispVal;
AutoWrap(DISPATCH_METHOD, NULL, pRange, L"Select", 0);
AutoWrap(DISPATCH_METHOD, NULL, pRange, L"Insert", 0);
pRange->Release();
}