Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nice to hear from you again. I wonder if I can ask you a question regarding
VBA. I have a program that open an excel file from select cell (see below). However, this program opens file just from the same directories. What happen if Ithe last directory changes all the time. For example instead 100 could be 200 or 300 or 400 and so on. Can the program be adjusted to get this new directory and find the file? Thanks in advance. Maperalia. '***PROGRAM STARTS***** Sub OpenSelectFilename1() directory = "C:\Test\Pants\Blue\100 "\" filetext = Selection.Value & ".xls" Workbooks.Open directory & filetext 'If filetext = ".xls" Then 'MsgBox "Please a FILE NAME to Open the file" 'End If End Sub "***PROGRAM ENDS******* '***OTHER PROGRAM STARTS***** 'Sub OpenExcelFile() ' directory = ThisWorkbook.Path & "\" ' filetext = Selection.Value & ".xls" ' If filetext = ".xls" Then ' MsgBox "Please a FILE NAME to Open the file" ' Exit Sub ' End If "***PROGRAM ENDS******* |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Dialog Box to return Selected File Path and Not Open it. | Excel Programming | |||
How can I make an Excel file selected in Explorer open automatica. | Excel Discussion (Misc queries) | |||
Open pdf file selected from excel | Excel Discussion (Misc queries) | |||
Excel file does not open when selected | Excel Discussion (Misc queries) | |||
EXCEL SELECTED FILE DOES NOT OPEN ONLY BLANK EXCEL MUST GO THROUG. | Excel Discussion (Misc queries) |