Can't find project or library issue

Hi,

I have this string of code to read from an ini.file but the system kept prompting an "Can't find project or library" error on the line: strBuffer = String(lBufferSize, " ")

I am using VB 6.0
Version 9971     VBA:Retail 6.4.9970     Forms3:11.0.5601

And I have attached the Reference-Project image

Hope some expert can help me resolve this issue, thank you.
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long


Sub read(o As GwxPick)

Dim strFilePath As String
Dim strBuffer As String
Dim lBufferSize As Long
Dim ret As Long
Dim strValue As String
Dim strSection As String
Dim strKey As String
Dim InputData As String

lBufferSize = 256
strBuffer = String(lBufferSize, " ")
InputData = "CHI_MAN_01" '*******************
strFilePath = "C:\Documents and Settings\user\Desktop\testing.ini"

strSection = "Country"
strKey = Split(InputData, "_")(0)

ret = GetPrivateProfileString(strSection, strKey, "", strBuffer, lBufferSize, strFilePath)
strValue = left$(strBuffer, ret)
ThisDisplay.GetVisibleObjectFromName("title").Text = strValue

strSection = "SubTitle"
strKey = Split(InputData, "_")(1)

ret = GetPrivateProfileString(strSection, strKey, "", strBuffer, lBufferSize, strFilePath)
strValue = left$(strBuffer, ret)
ThisDisplay.GetVisibleObjectFromName("subtitle").Text = strValue

End Sub

Open in new window

testing.ini
pic.JPG
csharp_learnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
Sounds like there's a conflict in the references. try this instead and see if the error still occurs...

    strBuffer = VBA.String(lBufferSize, " ")

Wayne

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
csharp_learnerAuthor Commented:
Thanks it passed that line but the same error got stuck on
strValue = left$(strBuffer, ret)
ZhaolaiCommented:
Similarly, try using:
strValue = VBA.Left(strBuffer, ret)
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

csharp_learnerAuthor Commented:
Thanks, worked perfectly.
ZhaolaiCommented:
csharp_learner,
Please recall this question and give webtubbs at least half of the points. I can't take the full credit. Thank you.
Wayne Taylor (webtubbs)Commented:
http:#a33944446 should have been accepted as the answer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.