UncleBajubjubs
Board Regular
- Joined
- Jul 11, 2017
- Messages
- 111
- Office Version
- 2010
Hello, I have a two excel workbooks, one (Workbook A) which is designed with a macro to pull in info from the other (Workbook B). Recently someone made changes to Workbook A that prevent the linking from occurring, but I do not know what they did. The VBA is identical to the an older version of the program which still works, so I assume the change exists on one of its worksheets. Since Workbook A is a massive program, (which is while it got separated from Workbook B as it slowed down Workbook B when they were one program a while ago) I assume it'd take forever to find the change.
The code in question is:
<code>
Sub LinkWorkbookB_Click()
Dim filename As Variant
Dim equals As String
Worksheets("Inputs").Unprotect
'Turn off Automatic Calculation
Application.Calculation = xlCalculationManual
' MsgBox "ThisWorkbook path is : " & ThisWorkbook.Path
filename = Application.GetOpenFilename()
If filename = False Then Exit Sub
' Range("ThisWorkbookPath") = ThisWorkbook.Path
Range("MechanicalProgramName") = filename
Range("AccelerationTime") = "='" & filename & "'!AccelerationTime"
</code>
Then are hundreds are variables that are linked, I only included the first one as that is the line that breaks, giving the "Run-time 1004: Method 'Range' of object '_Worksheet' failed" message. Any ideas?
The code in question is:
<code>
Sub LinkWorkbookB_Click()
Dim filename As Variant
Dim equals As String
Worksheets("Inputs").Unprotect
'Turn off Automatic Calculation
Application.Calculation = xlCalculationManual
' MsgBox "ThisWorkbook path is : " & ThisWorkbook.Path
filename = Application.GetOpenFilename()
If filename = False Then Exit Sub
' Range("ThisWorkbookPath") = ThisWorkbook.Path
Range("MechanicalProgramName") = filename
Range("AccelerationTime") = "='" & filename & "'!AccelerationTime"
</code>
Then are hundreds are variables that are linked, I only included the first one as that is the line that breaks, giving the "Run-time 1004: Method 'Range' of object '_Worksheet' failed" message. Any ideas?