Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default relative path

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default relative path

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative path Perico[_2_] Excel Programming 2 July 4th 07 09:58 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Absolute vs Relative path K2H Excel Discussion (Misc queries) 2 July 28th 05 12:50 PM
Relative path Giovaz Excel Programming 3 July 13th 04 02:21 PM
relative path. Bob Kilmer Excel Programming 0 September 12th 03 12:25 AM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"