Hi,
Some of the configurations you are referring to are done via the
regional settings (at least in the version of Excel I use): this means
that your separator may not always be the "!" in Excel (I have seen the
"." as well). When I need to have compatible workbooks (Excel and
Calc), I have a configuration page where there is a named cell (I
usually call it "SEP") that contains the formula (assuming "Sheet1"
exists):
=IF(ISERROR(INDIRECT("Sheet1.A1"));"!";".")
Then, when you need to dynamically build an address and extract the
content of the cell, you would use something like:
=INDIRECT("Sheet_Name"&SEP&"Cell_Address")
or
=INDIRECT(CONCATENATE("Sheet_Name";SEP;"Cell_Address"))
For the CELL("Filename") function, the only consistent element about it
is the "#" used as separator in the filename. You can place this
formula in a cell on your configuration sheet, and name the cell
APP_IS_EXCEL:
=IF(ISERROR(FIND("#",CELL("Filename"))),"Excel","Calc")="Excel"
Then you can use constructs like this:
=IF(APP_IS_EXCEL;something_for_excel;something_for_calc)
Also remember that when the workbook is not saved, Calc returns the
sheet name preceded by a "''#" (such as ""#$Sheet1), whereas Excel
returns a blank.
I hope this helps.
Rémy Gauthier.