I have some simple code that I use to save an embedded excel spreadsheet to disc:
Set EmbedObj = doc.EmbeddedObjects(0)
Set handle = uidoc.GetObject(EmbedObj.Name)
Call EmbedObj.Activate(False)
If Left(EmbedObj.class, 11)=“Excel.Sheet” Then
Answer = Messagebox ( “Do you want to save this document to your computer’s hard drive?”, 4+32+0+0, “File Save”)
If Answer = 6 Then
Answer = “”
Answer = Inputbox(“Enter the filename you want to save the document as.”, “File Save”) + “.xls”
If Answer = “.xls” Then
Messagebox “Document not saved.”
Exit Sub
End If
Call EmbedObj.Object.SaveAs (Answer)
Call EmbedObj.Object.Application.quit
Messagebox “Document saved to your folder My Documents.”
Else
Messagebox “Document not saved.”
End If
When I look in MyDocument and open the document that was saved, the worksheet is hidden and has to be “unhidden” each time. Has anyone else had this problem and is there a solution? I’ve check the postings in this forum and haven’t found any reference to it. Thanks in advance for your time and any suggestions.