PDA

View Full Version : VBScript Fails When I reopen Excel File



moetken
02-27-2008, 09:02 AM
I inserted a VBA function into my Excel file to reverse a string in a cell using:
Option Explicit
Public Function ReverseString (Text As String)
ReverseString = StrReverse (Text)
End Function

When I save and close the file then reopen the file the script does not run and I get a NAME? error in the cells. Any Suggestions?

Matt

Jan Karel Pieterse
02-27-2008, 09:14 AM
Did you put the function in a normal module?
Did you enable macros when opening (or maybe security is set to high?)

jamward
02-27-2008, 09:33 AM
hope this helps.

When you use the Option Explicit statement, you must explicitly declare all variables using the Dim, Private, Public, or ReDim statements. If you attempt to use an undeclared variable name, an error occurs.

-Jim
Grand Rapids, MI