Hi,

I'm fairly new to VBA, but have used other languages before, and I'm trying to open a second workbook and copy data across from it.

To try and teach myself this, I tried to just open a second workbook and write to it but it's not working. I also tried to add some message prompts to see how far it's getting, but they are not appearing as well. (Though the second work book does open on the screen)

My code is:
Code:
Sub Copy()

FileToOpen = Application.GetOpenFilename _
(Title:="Please choose a file to import", _
FileFilter:="Excel Files *.xls (*.xls),")

Set wbk = Workbooks.Open(FileToOpen)
MsgBox "Test2"
wbk.Sheets("Sheet1").Range("E16").Value = "Bob"
    
MsgBox "Test"

End Sub
Thanks for any help,
Paul