What I want to do is:
Ask the user to select the file they want to pull the data out of.
What I can't do is get the name of the damn file they select so I can pull data from it.
The following is pretty simple it gets the open dialog to asks them what to open. If its open it asks them if they want to re-open it. If you select no at this point it skips to the next part. That part works great.
All I want to do now is get the name of the file that was selected so that I can copy paste the data out of it but I can't seem to get thet working. If you select "don't reopen" the file is not active so I can't use that little trick.
Dim OpenFileName As Variant
Dim wBook As Workbook
Dim SampleReg As Workbook
On Error Resume Next ' if it stuffs out go to the next step
ActiveWorkbook = SampleReg
OpenFileName = Application.GetOpenFilename() 'Opens the File Dialog
If OpenFileName = False Then Exit Sub 'If no file selected stop
Workbooks.Open (OpenFileName) 'works
Databook = OpenFileName.Name
Range("P6") = OpenFileName