It looks like you have thrown a bunch of stuff together without
understanding what you are doing.
You have an active sheet, then open another workbook. Do you then want to
put formulas on the original sheet (reference is held in object sh) that
refers to the newly opened workbook? If so, see below, but it is unclear
if you want to dynamically determine a sheet in that workbook or it is
always going to be a sheet named D0023. If not D0023, then is it the first
sheet in that workbook. If not, then how to determine which sheet?
Dim sName As String
Dim sh As Worksheet
Dim myFile As String
Set sh = ActiveSheet
myFile = Application.GetOpenFilename("Excel Files, *.xls")
Workbooks.Open myFile
sName = ActiveWorkbook.Name
sh.Parent.Activate
sh.Activate
Range("A2").FormulaR1C1 = "='[" & sName & "]D0023'!R4C4"
' more of the same
Range(Range("A2"), Range("A2").End(xlToRight)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
End Sub