I developed an application in C# using MS Excel objects. The app works fine
on the computers with Excel 2000 installed, but gives an error on computers
with Excel 2002.
I checked an found out that my app cannot compile on PC with Excel 2002
because Microsoft has changed the numbers of parameters in some functions.
For example Workbooks.Open has 13 arguments with EXCEL 2000
Excel 2000 (13 arguments)
wb =
m_Excel.Workbooks.Open(Path.Combine(System.IO.Dire ctory.GetCurrentDirectory(
), "myfile.xls"),
optParam,optParam,optParam,
optParam,optParam,optParam,
optParam,optParam,optParam,
optParam,optParam,optParam);
but the same function with Excel 2002 has 15 arguments, so the compilation
failed.
How can I build my application, so it will work with both Excel 200 and 2002
?
Of course I can have 2 versions (with conditional compilation) but it seems
for me not the best aproach.
Any ideas?
Regards,
Yakimo