Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
Sorry if I don't make myself clear. I have a directory #1 with: - word document.docx -- the content is: abc - excel document.xlsx and another directory #2 with: - word document.docx --the content is: def When I move excel document.xlsx from directory #1 to directory #2 I need that the content of the cell, in excel, change from "abc" to "def". The cell in excel have to be make with a relative path and not with an absolute path to the file word document.docx. Can you help me? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could probably control it with an If statement in the Workbook_Open event.
expl: If ThisWorkbook.Path = C:\MyDocuments\directory #1\ Then Workbooks(exceldocument.xlsx).Range("A1") = "abc" ElseIf ThisWorkbook.Path = C:\MyDocuments\directory #2\ Then Workbooks(exceldocument.xlsx).Range("A1") = "def" End If Then in your underlying code in the Excel file, use a variable to reference Range("A1") to detect the abc or def. "Jorge mst" wrote: Hello Sorry if I don't make myself clear. I have a directory #1 with: - word document.docx -- the content is: abc - excel document.xlsx and another directory #2 with: - word document.docx --the content is: def When I move excel document.xlsx from directory #1 to directory #2 I need that the content of the cell, in excel, change from "abc" to "def". The cell in excel have to be make with a relative path and not with an absolute path to the file word document.docx. Can you help me? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Relative path | Excel Programming | |||
how to change absolute path to relative path | Excel Worksheet Functions | |||
Absolute vs Relative path | Excel Discussion (Misc queries) | |||
Relative path | Excel Programming | |||
relative path. | Excel Programming |