Open workbook line doesnt work....Help!

rob_sheeds

Board Regular
Joined
Dec 9, 2010
Messages
57
Works fine until last line....any tips? Maybe the book closing stops the last line from working??? Any suggestions?

Sub Retail_Trackers()
'
' Unprotect and Save as .xls Macro
Dim MyString As String

ActiveSheet.Unprotect Password:="sg6228"
ActiveWorkbook.Unprotect Password:="sg6228"
MyString = Range("F9") & " " & Range("E5") & " " & Range("B7") & " " & Range("I7")
FileDrive = "S:\Business Management\Retail Trackers\2012\4. October\"
ActiveWorkbook.SaveAs Filename:=FileDrive & MyString, FileFormat:=56

ActiveSheet.Protect Password:="sg6228"
ActiveWorkbook.Protect Password:="sg6228"
ActiveWorkbook.Save
ActiveWorkbook.Close

Application.Workbooks.Open Filename:="S:\Business Management\Retail Trackers\2012\4. October\Salons October.xlsm"
End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,
yes. you are closing the workbook then trying to run code. What you could do is put the line into the workbookclose event. if it only opens under a set of condidtions then can use an if statement.
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top