All the code that I’m am using is not listed, & I did not add that because some of it is opening a file for reference then displaying a message then closing the file, but before opening the file I am setting the worksheet to the "Raw Data" Tab
Private Sub Workbook_Open()
Sheets("Raw Data").Select
Range("D5").Select
Call open_File
MsgBox "Hello" & vbCr & _
"Excel has opened the" & vbCr & _
"Mpls_PW_Construction_Items_and_Prices.xls" & vbCr & _
"file to make sure your lookup data is Updated" & vbCr & _
"& now it will close the file" & vbCr & _
"Thanks for your Cooperation"
Call Close_File
If Range("d2").Value = "" Then Range("d2").Value = InputBox(Prompt:="Enter your name here if You are Responsible for Pasting this data into the project Plan Sheets (DGN'S)", Title:="ENTER YOUR NAME", Default:="")
End Sub
and in a macro named "Module_open_File" I have the following code
Sub open_File()
SaveLocation (False)
Workbooks.Open Filename:="http://cmean407/pw/0000/dms25500/Mpls_PW_Construction_Items_and_Prices.xls"
SaveLocation (True)
End Sub
Sub Close_File()
Windows("Mpls_PW_Construction_Items_and_Prices.xls").Activate
ActiveWorkbook.Close
End Sub
Public Sub SaveLocation(ReturnToLoc As Boolean)
Static WB As Workbook
Static WS As Worksheet
Static R As Range
If ReturnToLoc = False Then
Set WB = ActiveWorkbook
Set WS = ActiveSheet
Set R = Selection
Else
WB.Activate
WS.Activate
R.Select
End If
End Sub
'To save the current location, call SetSaveLoc.
Public Sub SetSaveLoc()
SaveLocation (False)
End Sub
'To return to the saved location, call GetSaveLoc.
Public Sub GetSaveLoc()
SaveLocation (True)
End Sub
Bookmarks