Sub My_Macro(Test, Path)
Dim sSheetName As String
Dim oRangeToCopy As Range
Dim FirstCell As Range, LastCell As Range
Worksheets(Test).Activate
Set LastCell = Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row, _
Cells.Find(What:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Column)
Set FirstCell = Cells(Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlRows, _
SearchDirection:=xlNext, LookIn:=xlValues).Row, _
Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, LookIn:=xlValues).Column)
sSheetName = Test ' worksheet to work on
With Worksheets(sSheetName)
.Range(FirstCell, LastCell).CopyPicture xlScreen, xlPicture
.Export Filename:=Path + Test + ".jpg", Filtername:="JPG"
End With
End Sub
Excel, doğrudan ekran görüntüsünü aldıktan sonra .Export yöntemini yürütmek istemiyor. Fotoğrafı yeni bir grafikte yapıştırmaya çalıştım.
... Herhangi bir fikir
O jpg Excel için geçerli bir ihracat biçimi Yani Excel kodda bunu zorlamak ne yapacağını bilmez (el bir Excel sayfası ihraç etmeye çalışırken listesine bakın) olduğunu düşünmüyorum . – Tom
Buradan bakın: http://www.mrexcel.com/forum/excel-questions/233108-visual-basic-applications-code-export-image-file-pre preferably-jpg.html –