![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2009
Posts: 11
OS: XP SP3
|
VBA Code Stops - When WB Is Opened By Another WB
I have 3 Work books - one (WB1) checks its version number against an online record and if they dont match it opens WB2 which then proceeds to download the updated version copy information from WB1 to its self which it then pastes into WB3
WB1 then gets deleted and WB3 Renamed to the old name of WB1 the issue i have is when i open WB2 using the button that also checks for updates on WB1. WB2's code seems to just stop when it gets to the point of updating WB3 no error messages or nothing it just stops! this is the code can any one see anything wrong NewMasters(2).xls = WB1 Updater.xls = WB2 NewVersion.xls = WB3 Code:
Function Update()
MsgBox "Download of NewVersion will now begin:" & Chr$(13) & "This can take up to 10 Minutes Depending on Your Connection", vbOKOnly, "Download Begin"
Download_File "http://www.drivehq.com/file/df.aspx/publish/stevebMTS/NewMastersUploads/NewVersion.xls", "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewVersion.xls"
Workbooks("NewMaster(2).xls").Worksheets("Setup Sheet").Range("A3", "C3").Copy
Workbooks("Updater.xls").Worksheets("NewMaster Updater").Range("A2", "C2").Select
ActiveSheet.Paste
Workbooks("NewMaster(2).xls").Saved = True
'Application.DisplayAlerts = False
Workbooks("NewMaster(2).xls").Close
'Application.DisplayAlerts = True
'-----THIS IS WHERE THE CODE STOPS - FOR NO REASON
Workbooks.Open ("C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewVersion.xls")
Workbooks("NewVersion.xls").Worksheets("Setup Sheet").Visible = True
Workbooks("NewVersion.xls").Worksheets("Setup Sheet").Activate
ActiveSheet.Unprotect ("0805198817051992")
Workbooks("Updater.xls").Worksheets("NewMaster Updater").Range("A2", "C2").Copy
Workbooks("NewVersion.xls").Activate
Workbooks("NewVersion.xls").Worksheets("Setup Sheet").Range("A3").Select
ActiveSheet.Unprotect ("0805198817051992")
Selection.PasteSpecial
Workbooks("NewVersion.xls").Save
Workbooks("NewVersion.xls").Close
SetAttr "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewMaster(2).xls", vbNormal
Kill "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewMaster(2).xls"
Workbooks.Open ("C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewVersion.xls")
Workbooks("NewVersion.xls").Worksheets("Setup Sheet").Visible = xlVeryHidden
Workbooks("NewVersion.xls").Worksheets("Command_ Sheet").Activate
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewMaster(2).xls"
ActiveWorkbook.Close
SetAttr "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewMaster(2).xls", vbReadOnly
Kill "C:\Documents and Settings\Steve Bennett\Desktop\Master Sheets\NewVersion.xls"
Application.DisplayAlerts = True
End Function
i am also going to double post on the Excel Forums - To See What i Get over there |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|