Hello,
My goal is to import data from an external wb into a new sheet in the active wb so I may summarize the external pages. So far my VBA program looks like this:
Sub Get_Data_From_File()
*Dim FileToOpen As Variant*
*Dim Openbook As Workbook*
*Application.ScreenUpdating = False*
*FileToOpen = Application.GetOpenFilename(Title:="Import Take-Off", FileFilter:="Excel Files(\*.xls\*),\*xls\*")*
*If FileToOpen <> False Then*
*Set Openbook = Application.Workbooks.Open(FileToOpen)*
*Openbook.Sheets(Template).Range("C1:V189").Copy*
*ThisWorkbook.Worksheets("sheet1").Range("A1").PasteSpecialxlPasteValues*
*Openbook.Close False*
*End If*
*Application.ScreenUpdating = True*
End Sub
The error I receive is one of two: Run-time error 9 (which I can fix) and run-time error 438. When error 438 appears the program has opened the external wb in the background but fails to copy the data into the new wb and new wb sheet. I could be missing something incredibly obvious here since I am new.