Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Update workbooks from a master


I have the code below to update workbooks from a master, thanks to Leit
Ross.

I want to change the code so it uses the original file name rather tha
add the Temp files. I have tried changing the WkbName to the same a
the existing workbooks but the workbooks are write reserved, when I ru
the code on these workbooks I get the message Error number = 1004
operation failed workbook is write reserved. I do know the password t
open the workbooks to enable write access so can add this to the code
if required.

Previous thread
http://www.excelforum.com/showthread...highlight=blue

Thanks Blue



Public Sub UpdateWorkbooks()

Dim Ret
Dim I As Integer
Dim W As Integer
Dim InputMsg As String
Dim WeekStr As String
Dim WkbName As String

On Error GoTo Fault

'Ask for the Week Number
InputMsg = "Enter the Week Number to start with below." & vbCrLf _
&"To Exit this Macro, Click Cancel or leave the entry below blank an
Click OK."

WeekStr = InputBox(InputMsg, "Update Workbooks")

If WeekStr = "" Then Exit Sub

W = Val(WeekStr)

'Update Workbooks Loop
For I = W to 52

'Save this Workbook as the New Workbook - Asks to Replace the File
WkbName = ThisWorkbook.Path & "\TEMP WK" & I & ".xls"
ThisWorkbook.SaveAs Filename:= WkbName, FileFormat:= xlWorkbookNormal

Next I

Fault:
Msg = "An Error has occurred. This macro will now Terminate." & vbCrL
_
& "Error Number = " & Err.Number & vbCrLf _
& "Message: " & Err.Description

Ret = MsgBox(Msg, vbOkonly + vbCritical, "Update Workbooks Macro")
Err = 0

End Su

--
blue10204
-----------------------------------------------------------------------
blue102040's Profile: http://www.excelforum.com/member.php...fo&userid=2552
View this thread: http://www.excelforum.com/showthread.php?threadid=38964

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 update a master workbook from 3 different slave workbooks? jtpryan Excel Discussion (Misc queries) 0 December 6th 07 08:41 PM
Update master workbook from individual workbooks Annabelle Excel Discussion (Misc queries) 0 February 16th 06 06:06 PM
How do I create a set of sheets that will update from a master? funky_funky_almonds Excel Discussion (Misc queries) 2 September 13th 05 03:59 PM
Import filter and update master Mikeice[_11_] Excel Programming 1 June 3rd 05 01:22 PM
How to update Macros from Master Macro? Joe HM Excel Programming 2 March 11th 05 12:50 PM


All times are GMT +1. The time now is 05:47 PM.

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"