Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with file name from cell
Hi all,
here is a real beginner question: I have got a named cell with path & xls-file name in it. What code do I need to open that specific file with a macro? Closely related to that topic: Do I always need the entire path or is it somehow possible to use a "relative path" from the location of the file where the macro is stored in? Finally, how do I remove a cell name so that the cell is again referred to as A1 or whatever? Simply deleting the name from the Name Box does not work... Thanks in advance, Thore |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open file with file name from cell
Code: -------------------- Dim MyPath As String Dim MyFile As String '----------------------- MyPath = ThisWorkbook.Path & "MyFolder\" MyFile = MyPath & ActiveSheet.Range("MyName").Value Workbooks.Open FileName:=ActiveSheet.Range(MyFile).Value -------------------- remove a cell name Insert/Name/Define ... select name and Delete. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vista Office 2003 File Open Window @details will only show file n. | Excel Discussion (Misc queries) | |||
Saved *.csv file gives SYLK file type warning upon Excel 2003 open | Excel Discussion (Misc queries) | |||
open file by inputting file name in cell? | Excel Discussion (Misc queries) | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
Office 2003 - "autocomplete" in file | open or file | save no longer works | Excel Discussion (Misc queries) |