作者:乔山办公网日期:
返回目录:excel表格制作
'需安装zd有打版印权机"Microsoft Office Document Image Writer"
Sub test()
On Error Resume Next
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).PrintOut ActivePrinter:="Microsoft Office Document Image Writer", PrToFileName:=Sheets(i).Name & ".mdi"
Next
End Sub
Public Sub PicName()
Dim Pth As String
Dim Pic As String
ActiveSheet.Range("A1").Select '选中激活窗口的A1
Pth = "C:\Users\Public\Pictures\Sample Pictures"
'路径,系统自带图copy片的地方
Pic = Dir(Pth & "\*.jpg") '查看JPG格式的图片名称zhidao
Do While Pic <> ""
Selection = Pic '赋值
Pic = Dir
Selection.Offset(1, 0).Select
Loop
End Sub
Excel 怎样通过VBA获取图片文件的像素属性
如下图代码所示:
Sub yy() Dim p As Shape, a$ For Each c In Range([a2], [a65536].End(3)) a = c.Value c(1, 2).CopyPicture With ActiveSheet.ChartObjects.Add(0, 0, c.Width, c.Height).Chart .Paste .Export "D:\picture\ " & a & ".jpg", "JPG" .Parent.Delete End With Next End Sub