Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) | Excel Programming | |||
Application.GetOpenFilename | Excel Programming | |||
Application.GetOpenFilename | Excel Programming | |||
Application.GetOpenFilename | Excel Programming | |||
Application.GetOpenFileName | Excel Programming |