Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This actually being done in VB.Net. But I am using hte Excel 12.0 object
model. I could not get an answer in the VSTO/VB forums and thought maybe I could get it here. Note as this is in VB I am using Excel enumerations but it is essentially VBA. I can do the following in VB: xlSheet.UsedRange.CopyPicture(Excel.XlPictureAppea rance.xlScreen, Excel.XlCopyPictureFormat.xlBitMap) 'Copy Image from Clipboard to temp folder Dim oImgObj As Image = Clipboard.GetImage oImgObj.Save(FileCompareFolder & "\[" & xlBook.Name & "]" & xlSheet.Name & ".bmp", System.Drawing.Imaging.ImageFormat.Bmp) However when I change the first line to (note the underlined portion) xlSheet.UsedRange.CopyPicture(Excel.XlPictureAppea rance.xlPrinter , Excel.XlCopyPictureFormat.xlPicture ) I get the following error message:"Object reference not set to an instance of an object." on the line: oImgObj.Save(FileCompareFolder & "\[" & xlBook.Name & "]" & xlSheet.Name & ".bmp", System.Drawing.Imaging.ImageFormat.Bmp) Why is this? When I do this manually by copying ot clipboard and saving in Paint I can use the bmp extension. Thanks EM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CopyPicture Method and "Picture/BitMap" Format | Excel Programming | |||
hyperlink no picture "No program is regitered to open this file" | Setting up and Configuration of Excel | |||
Default display format for "currency" data type | Excel Discussion (Misc queries) | |||
Where is the toolbar with the "bold type", "font type", options | New Users to Excel |