Hi all,
I am doing some work for my brother which is an Excel workbook with some code attached to a control button.
Essentially the code opens a named file and fills cells with data from another book.
My problem is that the code works absolutely fine on my machine and yet when I send him the file the code falls over at the point shown below. With him the code halts and shows a dialog box asking where to update the links from:
I have a variable already declared for "SourceFileCell"
Sub FormatFileWithExtract()
'Lots of code to do formatting of the current sheet etc etc etc
'*****
'Autofill formulae across and down to fill range
'*****
With Range("A2")
CODE FALLS OVER AT THIS LINE .FormulaR1C1 = "=IF(" & SourceFileCell & "= """",""""," & SourceFileCell & ")" '
.AutoFill Destination:=Range("A2").Range("A1:J1"), Type:=xlFillDefault
.Range("A1:J1").AutoFill Destination:=Range("A2").Range("A1:J19"), Type:=xlFillDefault
End With
Range("A1").Select
'*****
'Save the workbook
'*****
ActiveWorkbook.Save
End Sub
Can anyone possibly help and tell me why this code works fine with me but not with my brother when I send him the file.
NB we both have the same files saved just to the root of c for simplicity. We both run WinXP and Office 2003.
Any help would be much appreciated
Regards
Seamus
Bookmarks