Wondering if anyone could help me out on this one.
I've created the Function below (which I'm using as an Excel Add-in), which looks up a value of the selected cell (SKU) and returns the value it finds in a specific workbook that is stored on a specific location.
Right now this code it is working perfectly as long as I have that workbook open in another screen, but I can't seem to make it work when the workbook is closed.
I'm sure I need to add a reference to the file location somewhere/somehow (C:\Report\Inventory\Inventory.xlsm), but I've tried lots of different things but nothing has been working so far.
Does anybody know how can I make this work without having to open the workbook "Inventory" first?
Function CheckInventory(SKU)
CheckInventory = Application.WorksheetFunction.VLookup(SKU, Workbooks("Inventory.xlsm").Worksheets("Details").Range("$C:$AD"), 15, False)
End Function
I've created the Function below (which I'm using as an Excel Add-in), which looks up a value of the selected cell (SKU) and returns the value it finds in a specific workbook that is stored on a specific location.
Right now this code it is working perfectly as long as I have that workbook open in another screen, but I can't seem to make it work when the workbook is closed.
I'm sure I need to add a reference to the file location somewhere/somehow (C:\Report\Inventory\Inventory.xlsm), but I've tried lots of different things but nothing has been working so far.
Does anybody know how can I make this work without having to open the workbook "Inventory" first?
Function CheckInventory(SKU)
CheckInventory = Application.WorksheetFunction.VLookup(SKU, Workbooks("Inventory.xlsm").Worksheets("Details").Range("$C:$AD"), 15, False)
End Function