I would like to reference a Tablel:Field to use in the path instead of hard coding the file name, as the name of the file will change between the branches that use it
Expand|Select|Wrap|Line Numbers
- Dim strQryName As String, strXLFile As String, strXLFileName As String
- strDB = CurrentDb.Name
- strCurrentDir = Left(strDB, Len(strDB) - Len(Dir(strDB)))
- strXLFileName = ("SELECT [File Name] FROM [Paths] WHERE [Paths].[File Description]= *E-Room*")
- strXLFile = "" & strCurrentDir & strXLFileName & ".xls" strQryName = "Submit Road Rewards" 'Query Name
- Set xlApp = CreateObject("Excel.Application")
- Set wkb = xlApp.Workbooks.Open(strXLFile)
The Field names are "File Name" and "File Description"
Thanks for any help you can give