Watch this Author's files
Please ignore my previous comment. This would work! try Excel = evalin('base','Excel'); catch err Excel = evalin('caller','Excel'); end
How about we change the first line of code to Excel = eval('Excel');
Contact us at files@mathworks.com