logo
down
shadow

Save an embedded Word document in an Excel spreadsheet to disk using VBA


Save an embedded Word document in an Excel spreadsheet to disk using VBA

By : Mike Margetts
Date : October 17 2020, 11:12 PM
this will help Okay, I think I may have an answer, but it is only tested in Excel 2010.
code :


Share : facebook icon twitter icon
Save embedded word document from Excel VBA

Save embedded word document from Excel VBA


By : Dalux Thy
Date : March 29 2020, 07:55 AM
it fixes the issue I have created the below code for exporting an embedded Word document in a Excel Sheet to the workbook's path: , I guess you want this
code :
objWord.Application.Visible = False
objWord.Application.Quit
Save embedded word document from Excel (2007) VBA

Save embedded word document from Excel (2007) VBA


By : MattyS
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I have created the below code for exporting an embedded Word document in a Excel Sheet to the workbook's path: , Use this one isntead:
code :
objWord.SaveAs Filename:=ActiveWorkbook.Path & "\MyTemplate.docx", FileFormat:= _
    wdFormatDocumentDefault
objWord.SaveAs Filename:=ActiveWorkbook.Path & "\MyTemplate.docx", FileFormat:=16
Populating a combobox in Word from an embedded Excel spreadsheet

Populating a combobox in Word from an embedded Excel spreadsheet


By : J0N36O
Date : March 29 2020, 07:55 AM
I wish this help you I decided to use a Word.Table to store the data in my document instead of an embedded Excel object. I initially rejected this idea because I didn't know how to do it. I was only able to find Greg Maxey's code for populating from a Word.Table in a separate document. (The code in question can be found here. Scroll down to the section External Data Sources: Word table.)
However, after much tinkering around, I discovered that to populate a ComboBox from a Word.Table in the same document as the ComboBox you are populating, all you have to do is modify Maxey's code a bit. Simply change Set sourcedoc = Documents.Open(FileName:="D:\Data Stores\sourceWord.doc", Visible:=False) to Set sourcedoc = Me and remove the line sourcedoc.Close SaveChanges:=wdDoNotSaveChanges so the Doc being used won't be closed.
How to save an embedded Word document in an Excel workbook as a separate file using VBA

How to save an embedded Word document in an Excel workbook as a separate file using VBA


By : clastix
Date : March 29 2020, 07:55 AM
With these it helps I am creating a workbook that will populate an embedded Word document template with pictures, and then save the document elsewhere, without editing the embedded template. However, when I try to save the document, I get a Run-Time Error 4605 telling me: "The SaveAs method or property is not available because this document is being edited in another applicator" , I tested the following, which worked on my system/installation:
code :
Sub OpenWord()
'Opens the template when the main function first runs

    Dim WDObj As Object
    Dim WDApp As Object

    Set WDApp = GetObject(, "Word.Application")
    Set WDObj = Sheets("Template").OLEObjects("Template")

    WDObj.Activate
    WDObj.Object.Application.Visible = False

    WDApp.ActiveDocument.SaveAs ("YourFilename.doc")
    Set WDObj = Nothing
    Set WDApp = Nothing

End Sub
Access VBA automation able to save Word document to Sharepoint but not Excel spreadsheet

Access VBA automation able to save Word document to Sharepoint but not Excel spreadsheet


By : Sam Lau
Date : March 29 2020, 07:55 AM
should help you out The only thing I can think of to suggest is to set a workbook variable when you open the report so you can be absolutely sure which file is getting saved (though that in itself shouldn't cause an error...)
code :
Dim wb As Object   '<<<
Set oExcelApp = CreateObject("Excel.Application")
oExcelApp.Visible = True
oExcelApp.AskToUpdateLinks = False
oExcelApp.DisplayAlerts = False
Set wb = oExcelApp.Workbooks.Open("c:\apps\" & strReportName) '<<<
SPAddress = GetSPAddress()
wb.SaveAs SPAddress & strReportName '<<<
Related Posts Related Posts :
  • Setting workbook as a global variable - Subscript out of range
  • VBA: How to pass the contents from multi-checkbox (created in userform) to module
  • How to compare two dates in two cells in Excel?
  • How to find the first and last populated cell in a range with whitespace
  • Fixing overflow error when using Integer value
  • Adjust results after Import data from local html file
  • Weeknum that doesn't start from 1st every year
  • Fill Excel cells with colors using export method of Acumatica
  • How to improve this Class Module definition
  • Call Macro on a specific sheet / Excel
  • Simple VBA/Macro need to create a new text file with the contents of active sheet without changing filename
  • How do i create a routine that would constantly run in the background?
  • Is there a workaround when hitting the maximum summands in =sum in an Excel formula?
  • Generating an Excel spreadsheet with a Pivot Table over a large embedded data source?
  • Find start and end XY coords of perpendicular line calculated from start and end XY coords of baseline
  • TAB separated txt file from Excel VBA/MACRO
  • Exported CSV data not showing up correctly in Excel
  • How to copy just one sheet (not all) to .xls file in Excel VBA?
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org