Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Referencing the file type
Hi,
Is it possoble for an Excel cell to 'know' what type of file it belongs to? In other words, if a file is a template (ABC.xlt), can I display one value, and if it has been saved as a workbook (ABC.xls) can I display a different value? I need to show/hide a prompt to save the file as a workbook after a change has been made to the template. -- It''s a little fit bunny, this feeling inside |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Referencing the file type
There is probably an easier way, but in C1 enter:
=CELL("filename",A1) this will display something like: C:\Documents and Settings\Owner\Favorites\Links\e\spreads\[sendkey experiment.xls]Sheet1 Note the extension is buried in there. The in another cell: =IF(LEN(C1)=LEN(SUBSTITUTE(C1,"xls","")),"not xls","xls") -- Gary''s Student - gsnu200841 "EvilTony" wrote: Hi, Is it possoble for an Excel cell to 'know' what type of file it belongs to? In other words, if a file is a template (ABC.xlt), can I display one value, and if it has been saved as a workbook (ABC.xls) can I display a different value? I need to show/hide a prompt to save the file as a workbook after a change has been made to the template. -- It''s a little fit bunny, this feeling inside |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Referencing the file type
The following will return xls or xlt or Unknown Type if it is neither xls or
xlt. Note that it is one line although it breaks in this post =IF(ISERROR(FIND(".xls]",CELL("Filename"),1)),IF(ISERROR(FIND(".xlt]",CELL("Filename"),1)),"Unknown Type","xlt"),"xls") You can replace "Unknown Type" with "" to return a blank for neither xls or xlt. -- Regards, OssieMac "EvilTony" wrote: Hi, Is it possoble for an Excel cell to 'know' what type of file it belongs to? In other words, if a file is a template (ABC.xlt), can I display one value, and if it has been saved as a workbook (ABC.xls) can I display a different value? I need to show/hide a prompt to save the file as a workbook after a change has been made to the template. -- It''s a little fit bunny, this feeling inside |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Referencing the file type
Thanks Gary's Student... that is perfect.
It appears that the filename of a template is blank until it is saved, which is as informative for my purpose as if it had a name. -- It''''s a little fit bunny, this feeling inside "Gary''s Student" wrote: There is probably an easier way, but in C1 enter: =CELL("filename",A1) this will display something like: C:\Documents and Settings\Owner\Favorites\Links\e\spreads\[sendkey experiment.xls]Sheet1 Note the extension is buried in there. The in another cell: =IF(LEN(C1)=LEN(SUBSTITUTE(C1,"xls","")),"not xls","xls") -- Gary''s Student - gsnu200841 "EvilTony" wrote: Hi, Is it possoble for an Excel cell to 'know' what type of file it belongs to? In other words, if a file is a template (ABC.xlt), can I display one value, and if it has been saved as a workbook (ABC.xls) can I display a different value? I need to show/hide a prompt to save the file as a workbook after a change has been made to the template. -- It''s a little fit bunny, this feeling inside |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Referencing the file type
If you're using code, you can check the .path of the workbook.
If activeworkbook.path = "" then 'never been saved else 'saved at least once end if EvilTony wrote: Thanks Gary's Student... that is perfect. It appears that the filename of a template is blank until it is saved, which is as informative for my purpose as if it had a name. -- It''''s a little fit bunny, this feeling inside "Gary''s Student" wrote: There is probably an easier way, but in C1 enter: =CELL("filename",A1) this will display something like: C:\Documents and Settings\Owner\Favorites\Links\e\spreads\[sendkey experiment.xls]Sheet1 Note the extension is buried in there. The in another cell: =IF(LEN(C1)=LEN(SUBSTITUTE(C1,"xls","")),"not xls","xls") -- Gary''s Student - gsnu200841 "EvilTony" wrote: Hi, Is it possoble for an Excel cell to 'know' what type of file it belongs to? In other words, if a file is a template (ABC.xlt), can I display one value, and if it has been saved as a workbook (ABC.xls) can I display a different value? I need to show/hide a prompt to save the file as a workbook after a change has been made to the template. -- It''s a little fit bunny, this feeling inside -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saved *.csv file gives SYLK file type warning upon Excel 2003 open | Excel Discussion (Misc queries) | |||
How do you save an excel file to be read as IBM-type text file ? | Excel Worksheet Functions | |||
when inserting a file name in a cell how do you remove file type | Excel Worksheet Functions | |||
Referencing a 2nd file | Excel Discussion (Misc queries) | |||
How do I change file/open/"files of type" to default to "all file. | Excel Discussion (Misc queries) |