Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Marie,
This should not affect you since you're opening an existing file. But when you start a NEW file (File | New) it has no path, since it hasn't been saved to disk yet. Saving such a file in code results in a save to the current directory (usually your My Documents folder). Just thought I'd mention that. "Marie Bayes" wrote: Thanks Richard "RichardSchollar" wrote: Hi Marie You need the following where you have the workbook open statement: Workbooks.Open ThisWorkbook.Path & "\" & YourWorkbookName Then this will always open the file named "YourWorkbookName" in the same directory as the workbook that holds the macro code. Hope this helps! Richard On 25 Jan, 08:13, Marie Bayes wrote: Hi Is there any code I can put into my macro (which opens a file) that will always look for the file in the 'current' directory, ie, the directory that the original file was opened in, so that if I move the directory it will always find it? Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help (Uppercase multiple ranges?) | Excel Discussion (Misc queries) | |||
copy and use vba code | New Users to Excel | |||
Event (BeforeSave) - How to test VBA code? Dave P. can you hear me now? | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Macro for changing text to Proper Case | Excel Worksheet Functions |