Hey everyone,
I designed a Macro to copy data from another workbook that can be chosen each time.
It works all right, but if the source workbook is already open or I press cancel instead of choosing a workbook an error occurs in the last line I stated here. tried to solve it like that but it doesn't work:
Any ideas? Thanks for your help,
The Intern
I designed a Macro to copy data from another workbook that can be chosen each time.
Code:
Sub copydatafromotherworkbook()
Dim wkbk As Workbook
Dim myFileName As Variant
Set wkbk = Workbooks.Open(Filename:=myFileName)
.....
Code:
If myFileName = False Then
Exit Sub
End If
The Intern