Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open File based on filename in cell
I am using a combo box / Vlookup to populate a cell -say C3- with file name.
I want to use this to open the selected file. myFile = Selection.FormulaR1C1 Workbooks.Open Filename:=myFile However, since 'C3' is a Vlookup formula, the macro tries to open a file based on the formula rather than the results of the formula. Is there a way to have 'myFile' be read as the text of the cell contents? Thanks TB |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open File based on filename in cell
try it this way:
myFile = Selection.Text Workbooks.Open Filename:=myFile -- Hope that helps. Vergel Adriano "TOMB" wrote: I am using a combo box / Vlookup to populate a cell -say C3- with file name. I want to use this to open the selected file. myFile = Selection.FormulaR1C1 Workbooks.Open Filename:=myFile However, since 'C3' is a Vlookup formula, the macro tries to open a file based on the formula rather than the results of the formula. Is there a way to have 'myFile' be read as the text of the cell contents? Thanks TB |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open File based on filename in cell
Perfect. Thanks!
"Vergel Adriano" wrote: try it this way: myFile = Selection.Text Workbooks.Open Filename:=myFile -- Hope that helps. Vergel Adriano "TOMB" wrote: I am using a combo box / Vlookup to populate a cell -say C3- with file name. I want to use this to open the selected file. myFile = Selection.FormulaR1C1 Workbooks.Open Filename:=myFile However, since 'C3' is a Vlookup formula, the macro tries to open a file based on the formula rather than the results of the formula. Is there a way to have 'myFile' be read as the text of the cell contents? Thanks TB |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open File based on filename in cell
On Apr 26, 10:48 am, TOMB wrote:
I am using a combo box / Vlookup to populate a cell -say C3- with file name. I want to use this to open the selected file. myFile = Selection.FormulaR1C1 Workbooks.Open Filename:=myFile However, since 'C3' is a Vlookup formula, the macro tries to open a file based on the formula rather than the results of the formula. Is there a way to have 'myFile' be read as the text of the cell contents? Thanks TB dim myFile as String myFile = [C3].Value |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open File based on filename in cell
On Apr 26, 10:48 am, TOMB wrote:
I am using a combo box / Vlookup to populate a cell -say C3- with file name. I want to use this to open the selected file. myFile = Selection.FormulaR1C1 Workbooks.Open Filename:=myFile However, since 'C3' is a Vlookup formula, the macro tries to open a file based on the formula rather than the results of the formula. Is there a way to have 'myFile' be read as the text of the cell contents? Thanks TB This works for me regardless of the formula in C3... myFile = [C3].Value |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to open most recent file with a particular filename string | Excel Discussion (Misc queries) | |||
Open file with unknown extra characters at end of filename | Excel Programming | |||
Open file and print sheets based on data in cell | Excel Programming | |||
Macro to read filename in cell and open new file | Excel Programming | |||
Why doesn't the File Open list sort into filename order? | New Users to Excel |