jgottlieb
New Member
- Joined
- Jun 27, 2022
- Messages
- 4
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
I have a translation table that I am doing a lookup on when I open a spreadsheet. One of my underlying constraints is that the translation table could (and likely will) be moved to a different location on the network. I am working with an environment that has "System Folders" and "Applications" so ultimately, the translation table file will be in a folder like:
\\server\folder1\folder2\systemfolder\applicationfolder
Unfortunately, I am in a situation where I'm working with a management system that is organized by Domains and Projects. A Project lives in a Domain in the management system. For the environment, a Project in the management system translates to an "Application" which belongs to a "System Folder" (which doesn't necessarily map to a Domain.
I have a tab where I can control the values of what's needed:
The System Folder and the Application folder values in B2 and B3 are lookups to the translation table using B9 as the lookup value. I tried to concatenate the translation file location together, but that requires Indirect (which I don't have a great handle on) AND requires the translation file to be open. B5 and B6 are just concatenate functions of the application folder and additional folder information within the application folder structure.
I thought to have the user of the spreadsheet simply open the translation file as the first step of what this workbook ultimately is being designed to do. Since its location is off the Base Path (the folder structure I know will change), I created a macro to Open, then close the file (and attached it to a ribbon button:
Since this needs to be run every time someone will open the workboook, I made it automatically run on open. I put the following in ThisWorkbook:
UpdControl works perfectly when launched via the ribbon, everything updates as it should. When I open the workbook, I get the following error:
I'm not sure why I'm getting this error one way and not the other.
A couple things:
1. I'm going to have about 240 copies of this file (one for each "project" in the management system-we're doing extracts) so I don't want the translation table housed in this workbook. The translation table will start small and get added to as we go through future waves of exports. I suppose I *could* internalize it. I just would rather have one central and consistent location where this information is stored.
2. I could have the user use the ribbon button, but they'd have to do so every time the file is opened, not just when we're doing the extracts. So I'd really rather not go that route.
3. Am I even on the right track for this or is there a better way, given that the folder structure is being dictated to me (as complex and as variable as it is)?
I'm definitely open to ideas....even internalizing the translation table, if there's a good reason I haven't considered.
Thanks all for the help, it is much appreciated!
\\server\folder1\folder2\systemfolder\applicationfolder
Unfortunately, I am in a situation where I'm working with a management system that is organized by Domains and Projects. A Project lives in a Domain in the management system. For the environment, a Project in the management system translates to an "Application" which belongs to a "System Folder" (which doesn't necessarily map to a Domain.
I have a tab where I can control the values of what's needed:
The System Folder and the Application folder values in B2 and B3 are lookups to the translation table using B9 as the lookup value. I tried to concatenate the translation file location together, but that requires Indirect (which I don't have a great handle on) AND requires the translation file to be open. B5 and B6 are just concatenate functions of the application folder and additional folder information within the application folder structure.
I thought to have the user of the spreadsheet simply open the translation file as the first step of what this workbook ultimately is being designed to do. Since its location is off the Base Path (the folder structure I know will change), I created a macro to Open, then close the file (and attached it to a ribbon button:
VBA Code:
Sub UpdControl()
thePath = Range("BasePath").Value
Workbooks.Open thePath & "Master\Utils\ProjectTranslation.xlsx"
Workbooks("ProjectTranslation.xlsx").Close
End Sub
Since this needs to be run every time someone will open the workboook, I made it automatically run on open. I put the following in ThisWorkbook:
VBA Code:
Private Sub Workbook_Open()
call Main.UpdControl
End Sub
UpdControl works perfectly when launched via the ribbon, everything updates as it should. When I open the workbook, I get the following error:
I'm not sure why I'm getting this error one way and not the other.
A couple things:
1. I'm going to have about 240 copies of this file (one for each "project" in the management system-we're doing extracts) so I don't want the translation table housed in this workbook. The translation table will start small and get added to as we go through future waves of exports. I suppose I *could* internalize it. I just would rather have one central and consistent location where this information is stored.
2. I could have the user use the ribbon button, but they'd have to do so every time the file is opened, not just when we're doing the extracts. So I'd really rather not go that route.
3. Am I even on the right track for this or is there a better way, given that the folder structure is being dictated to me (as complex and as variable as it is)?
I'm definitely open to ideas....even internalizing the translation table, if there's a good reason I haven't considered.
Thanks all for the help, it is much appreciated!