A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hidden Background Data File



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2009, 04:56 PM
PSM PSM is offline
Member
 
First recorded activity by OfficeFrustration: Nov 2008
Posts: 22
Default Hidden Background Data File

Can you get Excel to open another Excel file linked to the first automatically (preferably hidden and read only) in the background ?
  #2  
Old June 15th, 2009, 09:19 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Hidden Background Data File

You could save the other workbook with its windows hidden, then either use a
macro to open it:

Option Explicit
dim OtherName as string
Sub Auto_Open()
dim OtherWkbk as workbook
dim OtherPath as string

otherpath = "C:\somefolder\" '- note the trailing backslash
othername = "book99.xls"

set otherwkbk = nothing
on error resume next
set otherwkbk = workbooks(othername)
on error goto 0

if otherwkbk is nothing then
'it's not already open
on error resume next
set otherwkbk = workbooks.open(otherpath & othername, readonly:=true)
on error goto 0
if otherwkbk is nothing then
'still didn't open
msgbox otherwkbk & " wasn't opened!"
end if
end if
end sub
'close this workbook when the "real" file closes????
Sub Auto_Close()
on error resume next
workbooks(othername).close savechanges:=false
End sub

(Untested. Uncompiled. Watch for typos.)




PSM wrote:

Can you get Excel to open another Excel file linked to the first
automatically (preferably hidden and read only) in the background ?

--
PSM


--

Dave Peterson
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:12 PM.


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