Sub ExportChart() Application.ScreenUpdating = False ActiveWindow.Zoom = 275 Dim path1 As String path1 = "C:\path\path\path\image.png" ActiveSheet.ChartObjects("chart name").Activate ActiveChart.Export FileName:=path1, FilterName:="PNG" ActiveWindow.Zoom = 47 Application.ScreenUpdating = True ...
事实证明,这是Excel 2010-2013用户的随机错误。但是,经过更多的谷歌搜索。我遇到了答案here 你只需要加...
(0,0, xl_range.Width, xl_range.Height) xl_range.CopyPicture()# add the chart to new sheetcht.Chart.Paste()# Export the sheet with the chart to a new filecht.Chart.Export(<image_filename>)# Delete the sheetcht.Delete() excel.ActiveSheet.Delete()# Close the bookexcel.ActiveWorkbook....
SubSave_Chart_As_Image()Dimmy_ChrtAsChartObjectDimf_PathAsString' Setting the file location to save the chart as imagef_Path="E:\Exceldemy\chart.png"' Picking up chart from the Export worksheetSetmy_Chrt=Worksheets("Export").ChartObjects("Chart 1")' Save the chart as PNG in the defined...
Export Excel Charts Directly Into Other Office Applications Many users looking to grab an Excel chart or graph out of a spreadsheet file simply want to use the image in another Microsoft Office application. Examples include embedding it in a quarterly report Word document, or displaying it as a...
With .Chart '图表对象中的图表 .Paste '粘贴之前复制的图形至图表 .Parent.Width = S.Width * 20 '图片无损缩放至原始大小的20倍宽 .Parent.Height = S.Height * 20 '图片无损缩放至原始大小的20倍高 .Export pa & Format(Now, "yyyymmddhhmmss") & ".jpg" '利用图表的export方法导图至此路径 ...
Chart.Export 方法 (Excel) 项目 2023/04/07 5 个参与者 反馈 本文内容 语法 参数 返回值 示例 以图形格式导出图表。语法表达式。导出 (FileName、 FilterName、 Interactive) expression:一个表示 Chart 对象的变量。参数展开表 名称必需/可选数据类型说明 FileName 必需 String 被导出的文件的名称。
chartObject.Chart.Export(savepath,self.ImageType)def_get_filename(self,chartname):""" Replaces white space in self.WorkbookFileName with the value given in self.ReplaceWhiteSpaceChar If self.ReplaceWhiteSpaceChar is an empty string then self.WorkBookFileName is left as is ...
chartObject.Chart.Export(savepath,self.ImageType) def _get_filename(self,chartname): """ Replaces white space in self.WorkbookFileName with the value given in self.ReplaceWhiteSpaceChar If self.ReplaceWhiteSpaceChar is an empty string then self.WorkBookFileName is left as is ...
Sub SaveChartAsGIF () Fname = ThisWorkbook.Path& "\" & ActiveChart.Name & ".gif" ActiveChart.ExportFileName:=Fname, FilterName:="GIF" End Sub 参考链接: http://soft.yesky.com/office/122/2296622.shtml 办法二:VBA编程: 用VBA先转成图片,并为有规律的图片名,插入PPT如果也用VBA实现,那只要...