Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open new instance of Excel with each Excel file opened island.fling Setting up and Configuration of Excel 0 July 30th 09 11:05 PM
Run Macro in another workbook already OPENED in another instance of Excel [email protected] Excel Programming 3 December 27th 06 04:37 AM
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM
Load a range of cells into a dataset with an opened workbook instance. [email protected] Excel Programming 0 May 31st 05 04:32 PM
Set up Excel to start new instance for each new file opened. Minimal_Subset Excel Discussion (Misc queries) 2 May 12th 05 01:36 AM


All times are GMT +1. The time now is 03:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"