View Single Post
 
Old 09-10-2022, 05:08 AM
Italophile Italophile is offline Windows 11 Office 2021
Expert
 
Join Date: Mar 2022
Posts: 542
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

In VBA each variable declared on the same line needs to be given a datatype. In your declarations only the last variable on the line is typed. This results in all the other variables being assigned the default datstype of Variant.

So

Code:
Dim scriptName, str_prompt, str_lower1,…
Should be

Code:
Dim scriptName as String, str_prompt as String, str_lower1 as String,…
Reply With Quote