// Create a png file stream FileStream outputStream = new FileStream("ExportRangeToImage.png", FileMode.Create); //create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); Stream fileStream = this.GetResourceStream("xlsx\\Personal Monthly Budget.xlsx"); //Open a xlsx file workbook.Open(fileStream); IWorksheet worksheet = workbook.Worksheets[0]; //Export range "B14:E25" to image worksheet.Range["B14:E25"].ToImage(outputStream, ImageType.PNG);
' Create a png file stream Dim outputStream = File.Create("ExportRangeToImage.png") ' Create a new Workbook Dim workbook As New Workbook Dim fileStream As Stream = GetResourceStream("Personal Monthly Budget.xlsx") ' Open a xlsx file workbook.Open(fileStream) Dim worksheet As IWorksheet = workbook.Worksheets(0) ' Export range "B14:E25" to image worksheet.Range("B14:E25").ToImage(outputStream, ImageType.PNG) ' close the image stream outputStream.Close()