Expandable Excel Table to Word Document2019 Community Moderator ElectionHow to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do you display code snippets in MS Word preserving format and syntax highlighting?Creating tables for copy from Word to ExcelWhat is the best way to insert source code examples into a Microsoft Word document?vba copy from word table to excelExcel to dynamic Word tablePasted linked Excel tables to WordReplace text in Word document from ExcelCreating Word documents from excel tableCan I use links to Excel tables with paste special in Word?
Is this Paypal Github SDK reference really a dangerous site?
What is the purpose of a disclaimer like "this is not legal advice"?
Under what conditions can the right to be silence be revoked in the USA?
Why is there an extra space when I type "ls" on the Desktop?
Do Paladin Auras of Differing Oaths Stack?
Either of .... (Plural/Singular)
If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?
I am the person who abides by rules, but breaks the rules. Who am I?
How can I portion out frozen cookie dough?
Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?
How to install round brake pads
Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?
Is it a Cyclops number? "Nobody" knows!
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?
Difference between `nmap local-IP-address` and `nmap localhost`
How do spaceships determine each other's mass in space?
Is there a way to make cleveref distinguish two environments with the same counter?
How would an energy-based "projectile" blow up a spaceship?
How do I raise a figure (placed with wrapfig) to be flush with the top of a paragraph?
What is this tube in a jet engine's air intake?
Yet another question on sums of the reciprocals of the primes
Insult for someone who "doesn't know anything"
Volume of hyperbola revolved about the y -axis
Expandable Excel Table to Word Document
2019 Community Moderator ElectionHow to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do you display code snippets in MS Word preserving format and syntax highlighting?Creating tables for copy from Word to ExcelWhat is the best way to insert source code examples into a Microsoft Word document?vba copy from word table to excelExcel to dynamic Word tablePasted linked Excel tables to WordReplace text in Word document from ExcelCreating Word documents from excel tableCan I use links to Excel tables with paste special in Word?
I need to link my Excel table in a Word document, but the option which is already in Word can only autorefresh a fix table size e.g. if I copy a 4x4 Table from Excel and paste it with link into Word it will stay 4x4. Only these cells can be refreshed, if I add a column or a row in Excel it doesn't appear in Word.
I hope you got my problem :D
excel vba ms-word document ole
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I need to link my Excel table in a Word document, but the option which is already in Word can only autorefresh a fix table size e.g. if I copy a 4x4 Table from Excel and paste it with link into Word it will stay 4x4. Only these cells can be refreshed, if I add a column or a row in Excel it doesn't appear in Word.
I hope you got my problem :D
excel vba ms-word document ole
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47
add a comment |
I need to link my Excel table in a Word document, but the option which is already in Word can only autorefresh a fix table size e.g. if I copy a 4x4 Table from Excel and paste it with link into Word it will stay 4x4. Only these cells can be refreshed, if I add a column or a row in Excel it doesn't appear in Word.
I hope you got my problem :D
excel vba ms-word document ole
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I need to link my Excel table in a Word document, but the option which is already in Word can only autorefresh a fix table size e.g. if I copy a 4x4 Table from Excel and paste it with link into Word it will stay 4x4. Only these cells can be refreshed, if I add a column or a row in Excel it doesn't appear in Word.
I hope you got my problem :D
excel vba ms-word document ole
excel vba ms-word document ole
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Mar 6 at 19:46
Cindy Meister
15.7k102337
15.7k102337
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Mar 6 at 15:42
HKKHKK
43
43
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
HKK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47
add a comment |
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47
add a comment |
2 Answers
2
active
oldest
votes
As a user, it's possible to double-click on the Excel object to activate it, then drag the frame to expand/contract it in order to show a different number of rows and/or columns.
There is no equivalent for this in the Word object model - it can't be done using code. Unless...
The table has been inserted with a link and a Link
field manages the link. In this case, it's possible to change the cell range specified in the Link
field and the embedded object will resize when the field is updated.
For example, if the Link
field code is for the range A1:B2
LINK Excel.Sheet.12 C:\Test\TestMergeData.xlsx Sheet1!R1C1:R2C2 a p
changing it to A1:C3 (R1C1:R3:C3) will display three rows and columns instead of two. (You can view and edit field codes by pressing Alt+F9.)
The VBA code would look like this:
Sub ChangeRangeLinkedExcel()
Dim fld As Word.Field
Dim ils As Word.InlineShape
Dim sFldCode As String
Dim posRangeStart As Long
Dim sLinkLeft As String, sRange As String, sLinkRight As String
For Each ils In ActiveDocument.InlineShapes
If ils.Type = 2 Then ' wdInlineShapeLinkedOLEObject
Set fld = ils.Range.Fields(1)
sFldCode = fld.code
posRangeStart = InStr(sFldCode, "!R")
sLinkLeft = Left(sFldCode, posRangeStart)
sRange = Mid(sFldCode, posRangeStart + 1, 9)
sLinkRight = Right(sFldCode, Len(sFldCode) - Len(sLinkLeft) - Len(sRange))
sRange = "R1C1:R3C3"
fld.code.Text = sLinkLeft & sRange & sLinkRight
fld.Update
End If
Next
End Sub
If the Excel object is not a Link
field then the only possibility I've ever found to change what it displays using code is to delete the object, then recreate it. When the new embedded object is insert it will automatically display the specified number of rows and columns.
add a comment |
Simply name the range in Excel before copying & pasting the link into Word. From then on, any changes to the scope or content of the named range in Excel will be reflected in Word.
Alternatively, if you've already established the link, name the range in Excel, then edit the field code in Word. To do this, select the linked range and press Shift-F9. It should now appear as something like:
LINK Excel.Sheet.12 "C:\Test\TestMergeData.xlsx" "Sheet1!R1C1:R2C2" a p
Change "Sheet1!R1C1:R2C2" (including the quotes) to your range name (without the quotes), then press F9 to refresh the link.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
HKK is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026936%2fexpandable-excel-table-to-word-document%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As a user, it's possible to double-click on the Excel object to activate it, then drag the frame to expand/contract it in order to show a different number of rows and/or columns.
There is no equivalent for this in the Word object model - it can't be done using code. Unless...
The table has been inserted with a link and a Link
field manages the link. In this case, it's possible to change the cell range specified in the Link
field and the embedded object will resize when the field is updated.
For example, if the Link
field code is for the range A1:B2
LINK Excel.Sheet.12 C:\Test\TestMergeData.xlsx Sheet1!R1C1:R2C2 a p
changing it to A1:C3 (R1C1:R3:C3) will display three rows and columns instead of two. (You can view and edit field codes by pressing Alt+F9.)
The VBA code would look like this:
Sub ChangeRangeLinkedExcel()
Dim fld As Word.Field
Dim ils As Word.InlineShape
Dim sFldCode As String
Dim posRangeStart As Long
Dim sLinkLeft As String, sRange As String, sLinkRight As String
For Each ils In ActiveDocument.InlineShapes
If ils.Type = 2 Then ' wdInlineShapeLinkedOLEObject
Set fld = ils.Range.Fields(1)
sFldCode = fld.code
posRangeStart = InStr(sFldCode, "!R")
sLinkLeft = Left(sFldCode, posRangeStart)
sRange = Mid(sFldCode, posRangeStart + 1, 9)
sLinkRight = Right(sFldCode, Len(sFldCode) - Len(sLinkLeft) - Len(sRange))
sRange = "R1C1:R3C3"
fld.code.Text = sLinkLeft & sRange & sLinkRight
fld.Update
End If
Next
End Sub
If the Excel object is not a Link
field then the only possibility I've ever found to change what it displays using code is to delete the object, then recreate it. When the new embedded object is insert it will automatically display the specified number of rows and columns.
add a comment |
As a user, it's possible to double-click on the Excel object to activate it, then drag the frame to expand/contract it in order to show a different number of rows and/or columns.
There is no equivalent for this in the Word object model - it can't be done using code. Unless...
The table has been inserted with a link and a Link
field manages the link. In this case, it's possible to change the cell range specified in the Link
field and the embedded object will resize when the field is updated.
For example, if the Link
field code is for the range A1:B2
LINK Excel.Sheet.12 C:\Test\TestMergeData.xlsx Sheet1!R1C1:R2C2 a p
changing it to A1:C3 (R1C1:R3:C3) will display three rows and columns instead of two. (You can view and edit field codes by pressing Alt+F9.)
The VBA code would look like this:
Sub ChangeRangeLinkedExcel()
Dim fld As Word.Field
Dim ils As Word.InlineShape
Dim sFldCode As String
Dim posRangeStart As Long
Dim sLinkLeft As String, sRange As String, sLinkRight As String
For Each ils In ActiveDocument.InlineShapes
If ils.Type = 2 Then ' wdInlineShapeLinkedOLEObject
Set fld = ils.Range.Fields(1)
sFldCode = fld.code
posRangeStart = InStr(sFldCode, "!R")
sLinkLeft = Left(sFldCode, posRangeStart)
sRange = Mid(sFldCode, posRangeStart + 1, 9)
sLinkRight = Right(sFldCode, Len(sFldCode) - Len(sLinkLeft) - Len(sRange))
sRange = "R1C1:R3C3"
fld.code.Text = sLinkLeft & sRange & sLinkRight
fld.Update
End If
Next
End Sub
If the Excel object is not a Link
field then the only possibility I've ever found to change what it displays using code is to delete the object, then recreate it. When the new embedded object is insert it will automatically display the specified number of rows and columns.
add a comment |
As a user, it's possible to double-click on the Excel object to activate it, then drag the frame to expand/contract it in order to show a different number of rows and/or columns.
There is no equivalent for this in the Word object model - it can't be done using code. Unless...
The table has been inserted with a link and a Link
field manages the link. In this case, it's possible to change the cell range specified in the Link
field and the embedded object will resize when the field is updated.
For example, if the Link
field code is for the range A1:B2
LINK Excel.Sheet.12 C:\Test\TestMergeData.xlsx Sheet1!R1C1:R2C2 a p
changing it to A1:C3 (R1C1:R3:C3) will display three rows and columns instead of two. (You can view and edit field codes by pressing Alt+F9.)
The VBA code would look like this:
Sub ChangeRangeLinkedExcel()
Dim fld As Word.Field
Dim ils As Word.InlineShape
Dim sFldCode As String
Dim posRangeStart As Long
Dim sLinkLeft As String, sRange As String, sLinkRight As String
For Each ils In ActiveDocument.InlineShapes
If ils.Type = 2 Then ' wdInlineShapeLinkedOLEObject
Set fld = ils.Range.Fields(1)
sFldCode = fld.code
posRangeStart = InStr(sFldCode, "!R")
sLinkLeft = Left(sFldCode, posRangeStart)
sRange = Mid(sFldCode, posRangeStart + 1, 9)
sLinkRight = Right(sFldCode, Len(sFldCode) - Len(sLinkLeft) - Len(sRange))
sRange = "R1C1:R3C3"
fld.code.Text = sLinkLeft & sRange & sLinkRight
fld.Update
End If
Next
End Sub
If the Excel object is not a Link
field then the only possibility I've ever found to change what it displays using code is to delete the object, then recreate it. When the new embedded object is insert it will automatically display the specified number of rows and columns.
As a user, it's possible to double-click on the Excel object to activate it, then drag the frame to expand/contract it in order to show a different number of rows and/or columns.
There is no equivalent for this in the Word object model - it can't be done using code. Unless...
The table has been inserted with a link and a Link
field manages the link. In this case, it's possible to change the cell range specified in the Link
field and the embedded object will resize when the field is updated.
For example, if the Link
field code is for the range A1:B2
LINK Excel.Sheet.12 C:\Test\TestMergeData.xlsx Sheet1!R1C1:R2C2 a p
changing it to A1:C3 (R1C1:R3:C3) will display three rows and columns instead of two. (You can view and edit field codes by pressing Alt+F9.)
The VBA code would look like this:
Sub ChangeRangeLinkedExcel()
Dim fld As Word.Field
Dim ils As Word.InlineShape
Dim sFldCode As String
Dim posRangeStart As Long
Dim sLinkLeft As String, sRange As String, sLinkRight As String
For Each ils In ActiveDocument.InlineShapes
If ils.Type = 2 Then ' wdInlineShapeLinkedOLEObject
Set fld = ils.Range.Fields(1)
sFldCode = fld.code
posRangeStart = InStr(sFldCode, "!R")
sLinkLeft = Left(sFldCode, posRangeStart)
sRange = Mid(sFldCode, posRangeStart + 1, 9)
sLinkRight = Right(sFldCode, Len(sFldCode) - Len(sLinkLeft) - Len(sRange))
sRange = "R1C1:R3C3"
fld.code.Text = sLinkLeft & sRange & sLinkRight
fld.Update
End If
Next
End Sub
If the Excel object is not a Link
field then the only possibility I've ever found to change what it displays using code is to delete the object, then recreate it. When the new embedded object is insert it will automatically display the specified number of rows and columns.
answered Mar 6 at 19:46
Cindy MeisterCindy Meister
15.7k102337
15.7k102337
add a comment |
add a comment |
Simply name the range in Excel before copying & pasting the link into Word. From then on, any changes to the scope or content of the named range in Excel will be reflected in Word.
Alternatively, if you've already established the link, name the range in Excel, then edit the field code in Word. To do this, select the linked range and press Shift-F9. It should now appear as something like:
LINK Excel.Sheet.12 "C:\Test\TestMergeData.xlsx" "Sheet1!R1C1:R2C2" a p
Change "Sheet1!R1C1:R2C2" (including the quotes) to your range name (without the quotes), then press F9 to refresh the link.
add a comment |
Simply name the range in Excel before copying & pasting the link into Word. From then on, any changes to the scope or content of the named range in Excel will be reflected in Word.
Alternatively, if you've already established the link, name the range in Excel, then edit the field code in Word. To do this, select the linked range and press Shift-F9. It should now appear as something like:
LINK Excel.Sheet.12 "C:\Test\TestMergeData.xlsx" "Sheet1!R1C1:R2C2" a p
Change "Sheet1!R1C1:R2C2" (including the quotes) to your range name (without the quotes), then press F9 to refresh the link.
add a comment |
Simply name the range in Excel before copying & pasting the link into Word. From then on, any changes to the scope or content of the named range in Excel will be reflected in Word.
Alternatively, if you've already established the link, name the range in Excel, then edit the field code in Word. To do this, select the linked range and press Shift-F9. It should now appear as something like:
LINK Excel.Sheet.12 "C:\Test\TestMergeData.xlsx" "Sheet1!R1C1:R2C2" a p
Change "Sheet1!R1C1:R2C2" (including the quotes) to your range name (without the quotes), then press F9 to refresh the link.
Simply name the range in Excel before copying & pasting the link into Word. From then on, any changes to the scope or content of the named range in Excel will be reflected in Word.
Alternatively, if you've already established the link, name the range in Excel, then edit the field code in Word. To do this, select the linked range and press Shift-F9. It should now appear as something like:
LINK Excel.Sheet.12 "C:\Test\TestMergeData.xlsx" "Sheet1!R1C1:R2C2" a p
Change "Sheet1!R1C1:R2C2" (including the quotes) to your range name (without the quotes), then press F9 to refresh the link.
answered Mar 6 at 21:45


macropodmacropod
2,7622310
2,7622310
add a comment |
add a comment |
HKK is a new contributor. Be nice, and check out our Code of Conduct.
HKK is a new contributor. Be nice, and check out our Code of Conduct.
HKK is a new contributor. Be nice, and check out our Code of Conduct.
HKK is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026936%2fexpandable-excel-table-to-word-document%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Double click on the table in Word. Then use the anchor points to expand (or contract it) as needed
– cybernetic.nomad
Mar 6 at 16:47