The expression get(sh1,'type') returns xlWorksheet for a worksheet object. However, there is no such type attribute for a workbook object. What is the most reliable way to test for a workbook object, ideally independent of Windows version and whether the host system is 32-bit or 64-bit. For that matter, it would be even more ideal if the test method was independent of whether Matlab and Excel was 32-bit or 64-bit. I'm not sure if Excel actually comes in both bit-widths, but the guiding idea is to write portable code that doesn't die just because I forget to bring my laptop and end up using a colleague's laptop.