I have a simple script that opens an excel file and copy the used range to cilpboard as image. It was working for at least 5 years. Now with the latest update from microsoft it is not longer working and throwing parameter error (-50). I have tried all combinations of optional parameters with appearance and screen. No matter what I try I always get this parameter error. Please suggest how can I change the parameters to make it working or confirm that it is not working for you too and hence a bug that should be reported to Microsoft. I have following code. The excel file is opened but then I get error -50 stating Parameter error. Parameter 'used range' is correct according to MS Excel dictionary documentation and the script works with Microsoft Excel 16.10.
set filepath to "/Users/ayesha/Documents/ayesha/test.xlsx" set scriptFilePath to POSIX file filepath tell application "Microsoft Excel" launch set myworkbook to open workbook workbook file name scriptFilePath copy picture used range of active sheet end tell