Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Macro to open, Update links, save and close workbooks

I have a few workbooks on our server that need to be opened, links updated,
saved and then closed again. It has to be done in a specific sequence and
each workbook has the same writeres password. I'm thinking along the lines of
having a master workbook open containing the macro. When I leave work in the
evening I can start the Macro and have all the workbooks updated by the next
morning. I have been testing this on one book only. It opens and updates but
it doesn't want to close it.
I don't know much about VBA and sort of been figuring things out as I go
along.

This is what I've been trying:

Sub OpenUpdateClose()
'
' OpenUpdateClose Macro
' Opens all workbooks, Updates them then saves and closes them
'
' Keyboard Shortcut: Ctrl+Shift+O
'
Dim wbk As Workbook

Application.DisplayAlerts = False

Set wbk = Workbooks.Open(Filename:="filename1.xls", _
UpdateLinks:=True, _
writeresPassword:="password")

With wbk
.Save
.Close
End With

Set wbk = Nothing


End Sub

Thanks in advance for the help
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
How to close all open workbooks in Excel 2007 Alojz Setting up and Configuration of Excel 0 September 17th 09 11:04 PM
Open and Close a Workbook to Update Links [email protected] Excel Discussion (Misc queries) 3 July 7th 08 07:55 PM
Workbooks Close, but window stays open Mari Excel Discussion (Misc queries) 2 January 16th 08 09:00 PM
Open Close workbooks bbc1 Excel Discussion (Misc queries) 2 August 28th 05 11:24 AM
Can you update links between workbooks without them both open? Nicolle K. Excel Discussion (Misc queries) 1 January 7th 05 07:39 PM


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

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

About Us

"It's about Microsoft Excel"