I recently purchased XLS Padlock and do not know exactly how to do this.
I have two programs both needing to be linked to the same companion file.
The first program (Item Master Data) needs to open the Excel companion file (Preferred Supplier Data) and paste certain information everytime the Item Master Data program is saved. - PLEASE HELP
The second program uses VLOOKUP from the Preffered Supplier Data file. - This should be doable if only I can get the first part to work.
The sole possibility is to place the companion file outside the two EXE files, in the same folder as the two EXE files. Then you’ll have to use full path references thanks to the VBA extension here:
I have the following code that needs to run everytime the Item Master Data program is saved (Please help):
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.ScreenUpdating = False
Dim wbIMD As Workbook, wbPSD As Workbook
Sheets("C").Activate
Set wbIMD = ThisWorkbook
'This is where the pathtofile needs to be used
Set wbPSD = Workbooks.Open(pathtofile("Preffered Supplier Data.xlsx"))
wbIMD.Activate
Sheets("Item Info Matrix").Select
Range(Range("A3"), Range("G" & Rows.Count).End(xlUp)).Copy
wbPSD.Activate
Range("A1").PasteSpecial xlPasteFormats
Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
Range("A1").Select
Range(Range("A1"), Range("a1").End(xlToRight)).EntireColumn.AutoFit
wbPSD.Close True
End Sub
How can I get the program to save over the originals files of both the application and companion files instead of asking me to name the new save file every time?