I've managed to copy the cell from the embedded excel sheet and use Home/Paste special/Paste link/Unformatted text in the word document body. If I change the cell value in the embedded sheet, the linked field in the document is updated accordingly.
The problem is that, once I close and reopen the word document, the link cannot be updated, it says "word is unable to create a link to the object you specified". If I open the 'edit links to files' pane, the excel worksheet object seems to receive a new name every time the word document is reopened excel object name
Do you see a workaround in this situation?
Thanks in advance for your help.
Problem solved! The document was originally created in a previous version of Word, with the excel object contained inside a table. Probably the table and excel objects were not properly migrated when saving the file to the 2013 .docx format. The solution was to simply delete the table row where the excel was contained, reinsert the row, embed the worksheet and recreate the link from the excel to the document body. It seems that the table and excel object were somehow reinitialized and the link is updating as it should.
Related
Please see attached image.
I showed a simplified version of what my sheet will be doing. But I will have nearly 100 check boxes, with 100 different topics.
My issue is I want to ONLY show content on the Word Doc when the associated checkbox is "true" on the excel sheet. It must also have 'Heading 1' formatting, and hyperlinks. What is my best path forward?
Have all the content prepopulated in the Word Doc, and have a macro that deletes content that isn't checked in the excel doc?
Start with a blank Word Doc, and populate only content that is checked in Excel.
I have successfully created a way to populate data from excel to word using bookmarks, but not sure how to remove content I don't need.
Thanks so much for your time!
excel to word example
I am trying to generate a Word document that consists of Excel information. When the Excel document updates I would like for the Word document to do the same.
I have managed to setup a template in Excel which carries over the information into Word seamlessly. The formatting is still a struggle though and if the Excel document changes I need to reproduce the whole Word doc from scratch again.
I am wondering whether it is possible to create the template in Word and "connect" it to the Excel (as the underlying information) easily using VBA?
What are some of the best practices or suggestions to try and go about doing something like this.
In Word, on the Insert tab, look at Insert Object. You have the option of inserting / linking part of the contents an Excel worksheet in the Word document. Once linked, whenever you open the Word document, its contents is automatically refreshed with the latest contents from the linked Excel worksheet.
The only thing that you have to be careful about with this solution, is that if you move your Excel files with respect to the Word document (to another folder), then when you open the Word document, Word will not be able to find the Excel documents. When implementing a solution like this, both the Word document and the linked Excel documents are typically kept / copied / moved together.
I am trying to create a presentation file which will contain many tables. These tables though might change. So, I would like to know if there is there a way to link the numbers of a table from an excel file, with the numbers of a table in a powerpoint slide ?
It's easy.
Steps:
Create the table in Excel
Copy the table in Excel
Prepare the slide in PowerPoint
Paste Special the Table on Your PowerPoint slide, using Paste Link
Resize and position the table object
And it's done!
Example:
Here's an example image of Paste Special and Paste Link options:
Hints:
If you update the Excel spreadsheet data, when the PowerPoint file is opened, the new data will be retrieved and displayed. (The system mays asks you to Update the linked data. Always update it with the latest information)
If you move the Excel file, the link will not be able to update as it won’t be able to find the file in the original location. If this happens, just fix the spreadsheet link location.
If you want to edit the data in Excel, you can double click on the table object on the PowerPoint slide and the Excel spreadsheet will open.
If you want to prevent others from changing the data in the Excel spreadsheet, make the Excel file a read-only file. (This will allow them to see the data in Excel when double clicking on the inserted table, but they won’t be able to save any changes to the file)
I have a VBScript and a method that inserts a picture from a .jpeg file into and excel sheet. I will like for the picture to save to the excel sheet so that when the excel file is sent to another person, they can view the picture.
I have noticed that picture links to the local folder on my computer from which i copied it.
Is there a way to save the inserted picture to be part of the Excel document?
This is my method
set attachment = .Pictures.Insert(path)
The Shapes.AddPicture Method has a parameter to specify whether
To save the picture with the document.
This solution to the same problem replaces .Insert with .AddPictured successfully (German, sorry).
We are trying to generate MS Excel workbook using OOXML and populate data using SSIS.
We are able to generate Workbook and sheets, also able to create columns and insert data in the Header cell. We can also populate data using SSIS.
But the Sheet (DocumentFormat.OpenXml.Spreadsheet.Sheet) and all cells (DocumentFormat.OpenXml.Spreadsheet.Cell) becomes OpenXmlUnknownElement. So we are not able to read sheet / cell using following code: Sheet sheet = workbookPart.Workbook.Descendants<Sheet>().Where(s => s.Name == "Sheet1").SingleOrDefault<Sheet>();
We are able to read the same file if we first open it using MS Excel and save. Does anyone know how to resolve this?
You probably forgot to give your sheet a name. You can see this by using
Sheet sheet = workbookPart.Workbook.Descendants<Sheet>().FirstOrDefault
and you'll see that your sheet name is either undefined or garbage text.
If that does not help. Create a simple document in code save it in OOXML and open it in a xml viewer. then make a copy open it in Excel and save it and see the difference in xml. That is often a good start seeing what excel has added by default to the document.
Excel is very tolerant of things that you have done wrong when creating the document in code, and magically fix them when you open the document again.
A bad hack would be using interop to open the document saving it again in code. wich would fix everything for you.
Workbook wrkbk = app.Workbooks.Open(#"c:\del.xls");
wrkbk.Save();
wrkbk.Close();