Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Updating Links

I have a consolidation file that has linked formulas from two other files (a
and b). Files a and b are password protected ( passwords are "one' and
"two", respectively), so when I open only the consolidation file and attempt
to update links, I have to key in the passwords. What I would like is a
macro assigned to a button that when clicked, would automatically open the
files, update the links, and then close the files.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Updating Links

You can see the syntax in VBA's help:

expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password,
WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter,
Editable, Notify, Converter, AddToMru, Local, CorruptLoad,
OpenConflictDocument)


option explict
sub auto_open()
dim wkbk1 as workbook
dim wkbk2 as workbook
dim wkbk3 as workbook

set wkbk1 = workbooks.open(filename:="c:\a.xls",password:="one ")
set wkbk2 = workbooks.open(filename:="c:\b.xls",password:="two ")
set wkbk3 = workbooks.open(filename:="c:\c.xls",password:="thr ee")

'wkbk3 is the real one!

wkbk1.close savechanges:=false
wkbk2.close savechanges:=false
'thisworkbook.close savechanges:=false
end sub

(I'd create a 4th workbook that opens the files in order and just closes the
first 2 and then itself.)




hurlbut777 wrote:

I have a consolidation file that has linked formulas from two other files (a
and b). Files a and b are password protected ( passwords are "one' and
"two", respectively), so when I open only the consolidation file and attempt
to update links, I have to key in the passwords. What I would like is a
macro assigned to a button that when clicked, would automatically open the
files, update the links, and then close the files.

Thanks.


--

Dave Peterson
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
Updating links BMA Excel Discussion (Misc queries) 2 July 6th 07 12:46 PM
Links not Updating Brian Links and Linking in Excel 2 June 1st 06 03:09 PM
updating links dave glynn Excel Discussion (Misc queries) 1 March 2nd 06 08:28 PM
Updating links Brian Excel Worksheet Functions 1 January 12th 05 03:05 AM
Updating links with VBA J. Toews[_3_] Excel Programming 1 October 22nd 04 04:45 PM


All times are GMT +1. The time now is 06:04 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"