|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
看见你凌晨3点多还在学习,值得佩服!不过再好的技术也需要健康的身体才能发挥,建议注意休息!
下面是将 已用区域 保存为图片:
- Private Declare Function OpenClipboard Lib "User32" (ByVal hWnd As Long) As Long
- Private Declare Function CloseClipboard Lib "User32" () As Long
- Private Declare Function GetClipboardData Lib "User32" (ByVal uFormat As Long) As Long
- Private Declare Function CopyEnhMetaFileA Lib "Gdi32" (ByVal hemfSrc As Long, ByVal lpszFile As String) As Long
- Private Declare Function DeleteEnhMetaFile Lib "Gdi32" (ByVal hdc As Long) As Long
- Sub lujkhua()
- Dim picnm As String
- picnm = Application.GetSaveAsFilename("try1.jpg", "图片, *.jpg", , "请选择保存路径并键入文件名")
- ActiveSheet.UsedRange.CopyPicture
- OpenClipboard 0
- DeleteEnhMetaFile CopyEnhMetaFileA(GetClipboardData(14), picnm)
- CloseClipboard
- End Sub
复制代码
|
|