Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with application.getopenfilename

Maybe off target, but when you get the problem, check in the VBIDE if there
are MISSING references. Goto ToolsReferences, and if any items are flagged
MISSING, uncheck them.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Andy TB" wrote in message
oups.com...
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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem with application.getopenfilename

Thanks - your suggestion worked! The Missing checkbox said that the
file comdlg32.ocx was missing from the windows/system32 directory. I
therefore copied it in from another PC and hey presto - the workbook
worked.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
Application.GetOpenFilename Nigel Excel Programming 0 March 23rd 05 03:24 PM
Application.GetOpenFilename Greg[_19_] Excel Programming 3 February 20th 05 01:55 AM
Application.GetOpenFilename Philipp Oberleitner[_2_] Excel Programming 2 July 9th 04 07:29 PM
Application.GetOpenFileName ptrowe Excel Programming 2 September 11th 03 12:54 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"