With Excel 2010 I had no problem populating and saving a Word template of a metric comprised of various charts, shapes, tables etc. to a .png file. This facility's monitors require image files and they were essentially a screen shot of the document.
But when I upgraded to Office 2016 this week the image file is a disaster! The charts are missing and the tables overlap. It contains barely 1/3 of the previous content and so is completely unusable.
The code saves the Word document as HTML which creates a folder with several files, the largest of which is my .png image file.
Clearly the functionality of SaveAs2 to the format wdFormatHTML has radically changed. Does anyone know how to recover the previous functionality? I don't see why this changed so radically.
But when I upgraded to Office 2016 this week the image file is a disaster! The charts are missing and the tables overlap. It contains barely 1/3 of the previous content and so is completely unusable.
The code saves the Word document as HTML which creates a folder with several files, the largest of which is my .png image file.
Code:
' Save in HTML format
wdapp.ActiveDocument.SaveAs2 Filename:=strBasePath & "..\Metric Sheets.html", FileFormat:=wdFormatHTML
On Error Resume Next
strFullPath = strBasePath & "..\Metric Sheets_files\"
strExt = ".png"
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
For x = 0 To UBound(arrCaptions)
strImageName = Replace(LargestImage(strFullPath), ":", "-")
destFile = strBasePath & strFolderName & "\" & imageName & strExt
If fso.FileExists(destFile) = True Then
fso.DeleteFile destFile
End If
fso.CopyFile Source:=strFullPath & strImageName, Destination:=destFile
Next
Kill strFullPath & "*.*"
fso.DeleteFolder strBasePath & "..\Metric Sheets_files"
Set fso = Nothing
Clearly the functionality of SaveAs2 to the format wdFormatHTML has radically changed. Does anyone know how to recover the previous functionality? I don't see why this changed so radically.