Это мой код экспорта изображения из Excel в файл
For Each oShape In ActiveSheet.Shapes
strImageName = oShape.TopLeftCell.Row & "_" & oShape.TopLeftCell.Column
If oShape.Type = msoPicture Then
oShape.Select
'Picture format initialization
Selection.ShapeRange.PictureFormat.Contrast = 0.5: Selection.ShapeRange.PictureFormat.Brightness = 0.5: Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic: Selection.ShapeRange.PictureFormat.TransparentBackground = msoFalse: Selection.ShapeRange.Fill.Visible = msoFalse: Selection.ShapeRange.Line.Visible = msoFalse: Selection.ShapeRange.Rotation = 0#: Selection.ShapeRange.PictureFormat.CropLeft = 0#: Selection.ShapeRange.PictureFormat.CropRight = 0#: Selection.ShapeRange.PictureFormat.CropTop = 0#: Selection.ShapeRange.PictureFormat.CropBottom = 0#: Selection.ShapeRange.ScaleHeight 1#, msoTrue, msoScaleFromTopLeft: Selection.ShapeRange.ScaleWidth 1#, msoTrue, msoScaleFromTopLeft
'/Picture format initialization
Application.Selection.CopyPicture
Set oDia = ActiveSheet.ChartObjects.Add(0, 0, oShape.Width, oShape.Height)
Set oChartArea = oDia.Chart
oDia.Activate
With oChartArea
.ChartArea.Select
.Paste
.Export ("D:\images\" & strImageName & ".jpg")
End With
oDia.Delete 'oChartArea.Delete
End If
Next
Этот код работает нормально, если я экспортирую в jpg, png, gif, bmp.
Но он не может экспортировать в TIF-файл.
Можно ли экспортировать изображение из Excel в файл TIF?
Как можно обрабатывать?
Спасибо.