Well, I suppose it's possible that your buffer is a bit too large. Try
doing it like this: Dim lSize As Long
Dim sString As String = New String(" ", 300) 'create the buffer; this is a better way than String$
lSize = GetPrivateProfileString("irsconnection", "irsconn", "", sString, 300, sFile)
sString = sString.SubString(0, lSize)That dynamically gets the required size, rather than fixing it in one
spot.
Also, you should not use String$, as it is a VB6 compatability function
and is not CLR compliant.