#1
|
|||
|
|||
Advanced Question about Links to Excel
Hello,
I am a first time poster, please excuse me if I posted in the wrong sub section. I am trying to create a word document for work that will improve the efficiency of a certain task. Here is what I would like to do.
{ LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r \* MERGEFORMAT } [Note: This part works. Now comes the part I do NOT know.]
Please help and I appreciate the one's who do! -Pete |
#2
|
|||
|
|||
This isn't exactly a "link" but a simple mailmerge. What you want is an IF field.
This example shows a mergefield named Field1. It prints: Field 1: contents of field 1 on a separate line if, and only if, there are contents in field1. If field1 can be a negative number you would want the condition to be <> 0. Turn on display of field codes when writing fields. Alt-F9 This is what the fields will look like. Note the line break in the middle of the IF field which is actually a paragraph mark in Word. { IF { MERGEFIELD Field1 } > 0 "Field1: { MERGEFIELD Field1} " "" } Note the braces {} cannot be typed in from the keyboard. They have to be inserted by Word. They come in pairs. They are inserted when you add a merge field or a regular field. You can make your own fields with Ctrl-F9 which inserts a pair. |
#3
|
|||
|
|||
How do I insert my previous link to exist as Field1?
|
#4
|
|||
|
|||
Sorry, I don't understand your question.
You may want to look at Mail Merge and the links from that page to better understand mail merge. |
#5
|
|||
|
|||
OK, now I think I understand.
{ IF { LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r \* MERGEFORMAT } > 0 "Field1: { LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r \* MERGEFORMAT} " "" } Again, I think you would be better off using mail merge structure rather than link. The line above inserts your value from your spreadsheet if that value is greater than 0, together with an identifier "Field1: " here. It also inserts a new paragraph. If the value is blank or not greater than 0, it will not insert anything. |
#6
|
|||
|
|||
Ok i tried it and I am getting "Error! Missing test condition." when I try to update it. Why is this happening? This is what it looks like so far.
{ IF { LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r \* MERGEFORMAT } > 0 "Field1: { LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet2!R1C1:R4C4" \a \f 4 \r \* MERGEFORMAT } " "" } |
#7
|
||||
|
||||
Hi Peter,
With the field code, you must have a space either side of the '0'. Spaces for the rest are inconsequential and your field code could be reduced to: {IF{LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r}> 0 "Field1: {LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet2!R1C1:R4C4" \a \f 4 \r}"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Try adding a set of quotation marks:
{ IF "{ LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet1!R2C1:R2C3" \a \f 4 \r \* MERGEFORMAT }" > 0 "Field1: { LINK Excel.Sheet.8 "C:\\Documents and Settings\\*FAKE FOLDER\\FAKEFILE.xlsx" "Sheet2!R1C1:R4C4" \a \f 4 \r \* MERGEFORMAT } " "" } Otherwise, when I debug or build IF fields, I start out simple with only the IF field. { IF "test" = "test" "true" "false" } and make sure I get the expected result. Then step by step I substitute in what I want to use until I have a complete working IF field. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
External/Embedded links to excel | lucas | Word | 3 | 03-30-2012 01:47 PM |
Edits links to Excel file in PowerPoint | ziba | PowerPoint | 4 | 01-09-2012 08:48 AM |
Powerpoint 2010 losing links to excel | Hans_b | PowerPoint | 0 | 07-12-2011 04:19 AM |
Updating Excel Chart Links | fermat | PowerPoint | 0 | 07-09-2010 04:29 PM |
Break Links with Excel | streng | Word | 0 | 06-29-2009 02:43 AM |