Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBA/Excel compile error: expected array

Status
Not open for further replies.

morgface

Technical User
Jul 23, 2003
5
0
0
US
Hello!

I was wondering if anyone might be able to offer me some advice regarding a problem that I am getting when compiling some VB script in MS Excel.

I have ensured that he has been defined properlyetc. However when I run the below bit of VB , I get a "Compile Error: Expected Array"

gk_strConnectionString = GetINIFileParameter("connectionstring")
If Left(gk_strConnectionString, 5) = "ERROR" Then
GoTo ErrHandler
End If

I have found that on one colleagues machine it runs fine... however when I try and run it on mine it errors. I have checked that I am running with the same version of Excel, and that we have the same references ticked within VBAProject. Can anyone offer me any advice regarding this problem.

Many thanks,

Sarah
 
Sarah,

What is the function GetINIFileParameter expecting? I assume that's a custom function.

Also, have you identified anything that is different between your computer and the one the code runs on? Perhaps Option Explicit is turned on for yours, or do the two computers have different flavors of Windows, or???

VBAjedi [swords]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top