Hey Guys,
Hoping someone can help me out, I have a file use to pull in data for me from various sources I am trying to get it so other people can use it as well to help them out to not have to manually pull in data.
However when ever i try to link the ChDir to the file location on the SetUp tab cell B3. Could someone help me out with the code to open and repair the file in Sheets("Set Up").Range("B3")
Sub OpenZproj()
'
' OpenZproj Macro
' Open Zproj file saved from SAP and copy into the sheet
'
Dim sPath As String, sFile As String
Dim oWB As Workbook
sFile = Sheets("Set Up").Range("B3").value
'On Error GoTo Err_Open
Sheets("ZPROJ").Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
ChDir "C:\Users\Kyddgorg\Desktop\SAP Reports"
Set oWB = Workbooks.Open(sFile, CorruptLoad:=XlCorruptLoad.xlRepairFile)
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Windows("Cost Tracker Wizard.xlsm").Activate
Cells.Select
ActiveSheet.Paste
Windows("zproj.xlsx").Close
Exit Sub
Bookmarks