Thread: GetOpenFilename
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Juan Pablo González Juan Pablo González is offline
external usenet poster
 
Posts: 226
Default GetOpenFilename

Application.GetOpenFilename doesn't open the file, it just returns the
filename that the user chose OR False, if the user canceled.

Is the book open when you try to assign the range ? if so, then you don't
need GetOpenFileName, if its not, then try

Set Rng = Workbooks.Open(Book).Worksheets("Sheet1").Range("A 1")

--
Regards

Juan Pablo González

"Roman" wrote in message
...
Here's my example:

Book = Application.GetOpenFilename
Set Rng = Workbooks(Book).Worksheet("Sheet1").Range("A1")

It results in error because GetOpenFilename returns a full file path, not
file name.
Is there a way to solve this?

Thanks