Link to home
Start Free TrialLog in
Avatar of pliant6
pliant6

asked on

An error occurred initializing the VBA libraries (265) - MS Excel

I am having a problem when i try to open an .xlt excel file.

In Windows2000 with Excel 2000 when I double click on the xlt file to open it I am given the Macros prompt and I click on "Enable Macros" (I've tried clicking "Disable Macros" but still have the same results).  Then I am receving the message: "An error occurred initializing the VBA libraries (265)".  

I click ok on the message and then the Excel application stays open but the Excel file does not open.  If i open the Visual Basic Editor from inside Excel and then try to open the file I receive a "Device I/O" error message.  

In WindowsXP with Excel 2002 I eventually receive a message box saying:
"Errors were detected in 'filename.xlt', but Microsoft Excel was able to open the file by making the repairs listed below. Save the file to make these repairs permanent.  Lost Visual Basic project. Lost ActiveX controls."

When I click Ok the template opens but there is no data in it as there should be.  There is just the header and column headings.

When I then save the file, the file size is goes to 33K instead of the 125K it started at originally.

I've found some articles on Microsoft.com that deal with similar issues but in Excel97 and when I've tried their fixes I still end up with the save problem.  

I've tried opening other xlt files that contain macros as well and they work find.  Any ideas of things I can try to get this file opening properly?  Thanks!
Avatar of byundt
byundt
Flag of United States of America image

Hi pliant6,
Are there supposed to be VBA macros in the template? If so you may want to try "cleaning" them using Rob Bovey's VBA CodeCleaner http://www.cpearson.com/excel/xltools.htm 

Have you tried Excel 2002's File Repair and Open tool? To access it, use the File...Open menu item. Choose your file, then click the triangle to the right of the Open button. Choose File Repair and Open.

Cheers!

Brad
Avatar of pliant6
pliant6

ASKER

Yes, when I use the Repair and Open tool in Excel 2002 is when I get the: "Errors were detected in 'filename.xlt', but Microsoft Excel was able to open the file by making the repairs listed below. Save the file to make these repairs permanent.  Lost Visual Basic project. Lost ActiveX controls."

When i tried the VBA Code Cleaner I get a message saying: "Programmatic access to Visual Basic Project is not trusted (CodeCleanerMain).

:(
pliant6,
No comment has been added lately (62 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Accept byundt's answer http:#9800114 and Refund

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

turn123
EE Cleanup Volunteer
Avatar of pliant6

ASKER

I would like to request a refund.  Nothing helped to fix this file as it was being corrupted during a Kermit file transfer.
pliant6,

If you want to delete this question, post a zero-point question in https://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Delete
Body: Please delete this question:
https://www.experts-exchange.com/questions/20805493/An-error-occurred-initializing-the-VBA-libraries-265-MS-Excel.html

or you could just leave it as my recommendation was for you to get a refund.

Turn123
ASKER CERTIFIED SOLUTION
Avatar of SpazMODic
SpazMODic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Possible fix
open the workbook in Excel 2002 and hit Alt +F11
Insert from the tool bar
then Module
Select Tools and references
make sure Visual Basics for applications is selected
Add Active controls are also checked


Good Luck!!