View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy TB Andy TB is offline
external usenet poster
 
Posts: 2
Default Problem with application.getopenfilename

In my laboratory I routinely import txt based instrumental data into
Excel for further processing. I have therefore written many workbooks
using the "application.getopenfilename" VBA code as a convenient means
of finding and importing the data.
What is unusual is that this line of code only works on some of my
computers and not on others. On the ones that don't, I get the error
message "Could not load an object because it is not available on this
machine" followed by "Compile Error: Can't find project or library".
Failure of this code to work is not related to the age of the PC.
I have solved the problem as follows but don't know why it works - if
anyone can enlighten me as to why, I would be most grateful.....
I load up the workbook on a problem computer alongside a blank
workbook. I then drag and drop the worksheets from the problem workbook
into the blank. I then drag and drop the VBA modules and userforms from
the problem workbook into the blank. I then save the blank.
If I now run the new workbook, the above code works prefectly!