Question:
Excel VBA: Error in loading DLL?
mambo
2009-08-22 01:28:02 UTC
Hi, when I try to save my excel file, a box pop up saying document not saved. I have tried to save as a different name, also tried to save in external drive, but it still doesn't work.
I written codes in VBA, a box pop up saying 'Error in loading DLL' when I run the macro, then the 'Help' box pop up saying 'This feature is not installed', I not sure what to do, as I've been working on this excel file for days, it seem working well, the Error just suddenly occur last night.
I did a test, simply create a new workbook (without using VBA), and try to save the file, it work OK, excel does saved the file.

Please, I need advice.
Five answers:
siti Vi
2009-08-22 07:04:51 UTC
from VBE (Visual Basic Editor)

click menu Tools > References..

to see if there are MISSING references
?
2017-01-20 23:20:57 UTC
1
zabel
2016-10-14 09:54:11 UTC
Error In Loading Dll
?
2016-05-26 08:37:00 UTC
I totally agree with Garbo. Your code is fine. It's good practice to define the variable type and it would be good to define sheet_name as a string, but it should still work. Your problem sounds like the user is typing in a name in B1 that is not a worksheet in your workbook. Excel then searches for that worksheet and can't find it and returns an error, likely an out of range error like Garbo said. The simplest method to fix your problem would be to use Excel's data validation to ensure that they enter a worksheet name that is in the workbook in cell B1. The problem with having the user type in the name is that if the name isn't typed in exactly then you'll get an error. When I do something like this, I normally create a combo box then load the combo box with the list of worksheet names. You can do this with the row source property and use a range that has the names. Or you can loop through the worksheets with a for next loop and add them to the list one by one. This is the best method because it grabs the current names and grabs worksheets that have been added, etc. Someone could possibly change a worksheet name or add a new sheet. Then you can use the combo box's list index property to make sure somebody grabs a name from the list. As long as the list index is not -1, that means they grabbed a value from your combo box's list.
anonymous
2009-08-22 02:01:24 UTC
below a link you may want to check out. It may be useful to you

http://support.microsoft.com/?scid=kb%3Ben-us%3B282847&x=16&y=11


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...