Hi -

I've been really struggling with this one. I am trying add a value from an open workbook to a closed workbook and then add a status code 6 positions to the right, an "A". I have tried several different ways and used many others code and manipulating them but I am continually getting object errors even if the objects are declared and set. Now when I run the code, I get something flashing in the background and instead of my workbook name in the project window where my macro resides, (my workbook name: "Approve PO.XLSM") it switches to FUNCRES.XLAM and the screen flickers and the macro ends. I can't see anything in the watcher window. I am not very good with code so any help will be appreciated. Here is the line of code where it happens, Set OutputFile = Workbooks.Open("J:\Manual PO's\Manual PO Log\Manual PO Log.xlsx")....it is expecting a function or variable?


Sub Update_Log_Status()
Dim InputFile As Workbook
Dim OutputFile As Workbook
Dim Inputpath As String
Dim Outputpath As String
Dim sht1 As Worksheet
Dim gFound As Range


'copy what you want from InputFile:
Set InputFile = ActiveWorkbook

''Workbooks.Open Filename:="C:\WorkbookName1.xls"

'## Open both workbooks first:
Set OutputFile = Workbooks.Open("J:\Manual PO's\Manual PO Log\Manual PO Log.xlsx")
'Grab the first sheet
Set sht1 = OutputFile.Sheets(1)

'Workbooks.Open ("J:\UML_Inventory\Manual PO's\Manual PO Log\Manual PO Log.xlsx")


'paste to OutputFile worksheet:
ActiveSheet.Range("B21").Value = OutputFile.Worksheets("Log").Range("L1").Value

Set rgFound = Range("D:D").Find(Range("L1").Value, After:=Range("D3"))

If rgFound Is Nothing Then
Debug.Print "Selection not found"
Else

End If