C#Microsoft.Office.Interop.Excel.Range.CopyPicture在一些计算机上工作,但不在其他人上

我试图将所选Excel范围的图片复制到剪贴板,并在我的GUI上显示该位图。 我有这个方法来获取位图:

using Excel = Microsoft.Office.Interop.Excel; public static Bitmap CopyPicture(ref Excel.Range range) { System.Threading.Thread.Sleep(1000); //Google told me... range.Select(); //...that these lines are possible fixes. range.Copy(); //They aren't. try { range.CopyPicture(Excel.XlPictureAppearance.xlScreen, Microsoft.Office.Interop.Excel.XlCopyPictureFormat.xlBitmap); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } IDataObject data = Clipboard.GetDataObject(); if (data != null) { if (data.GetDataPresent(DataFormats.Bitmap)) { Bitmap map = (Bitmap)data.GetData(DataFormats.Bitmap, true); MessageBox.Show("Return map"); return map; } } MessageBox.Show("Return null"); return null; } 

问题是,在我的计算机上(我用来开发)和另一台计算机上,这个解决scheme工作得很好,我得到了我想要的图片。 在其他一些计算机上它不起作用, range.CopyPicture(...)抛出这个COMException

所有这些计算机都有最新的Excel更新,并且正在运行Windows 7.使用不同的用户(pipe理或不pipe理)没有区别。

所有的帮助表示赞赏,我一直坚持这一两天了。