Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get reference to a file opened in another instance of XL
Using Office 2003;
Generic: I need to loop thru all open MS-Excel files in another instance of XL with the object in mind of getting a reference to a particular file opened as a template. I can positively identify the template file by the contents of certain cells in the template. Specific: The user will be opening an Oracle Financials, Fixed Asset (CPR) ADI spreadsheet which always opens in a new instance of XL. I need to get a reference to this spreadsheet and populate it with data from an array. I can do all of this just fine, but it's the reference to the other instance that is a challenge. Any help would be appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get reference to a file opened in another instance of XL
Assuming that both instances of Excel use your Windows Registry, how about...
in the 1st instance of excel, put the filename you want the 2nd instance to know about into the registry and then in the 2nd instance of excel, take the filename out of the registry and open the file or whatever? Excel puts the information into... HKEY_CURRENT_USER\Software\VB and VBA Program Settings\ Examples: 'put data in registry in a macro in 1st instance SaveSetting APPNAME:="MyFileName", _ section:="FileName", Key:="Value", _ setting:=ActiveWorkbook.FullName - - - - - - - - - 'get data out of registry using a macro in 2nd instance strMyFileName = GetSetting(APPNAME:="MyFileName", _ section:="FileName", Key:="Value") 'open the file in the 2nd instance Workbooks.Open Filename:=strMyFileName -- Hope this helps. Thanks in advance for your feedback. Gary Brown "XP" wrote: Using Office 2003; Generic: I need to loop thru all open MS-Excel files in another instance of XL with the object in mind of getting a reference to a particular file opened as a template. I can positively identify the template file by the contents of certain cells in the template. Specific: The user will be opening an Oracle Financials, Fixed Asset (CPR) ADI spreadsheet which always opens in a new instance of XL. I need to get a reference to this spreadsheet and populate it with data from an array. I can do all of this just fine, but it's the reference to the other instance that is a challenge. Any help would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open new instance of Excel with each Excel file opened | Setting up and Configuration of Excel | |||
Run Macro in another workbook already OPENED in another instance of Excel | Excel Programming | |||
stop excel file opened as read only if already opened by another u | Excel Programming | |||
Load a range of cells into a dataset with an opened workbook instance. | Excel Programming | |||
Set up Excel to start new instance for each new file opened. | Excel Discussion (Misc queries) |