I'm getting the above error at this section --> SetCurDir ("\\Cls000008\actuarial_data\Xtractor") in my code below ... please help !
_____________________________________

Option Explicit

Private Declare Function SetCurDir Lib "kernel32" _
Alias "SetCurrentdirectoryA" (ByVal lpPathName As String) As Long

Public Sub Extract_POL(strinputfile, lngTOTpno, blnPOL, blnIDAT, blnTcode, _
blnHPTAR, blnTerm, blnOccode, blnAge, blnPollines, blnWBN, blnTax)

Dim strtemp, stroutputfile, strinputline, startPOL, endPOL As String
Dim blnSKIP, blnALREADY As Boolean
Dim a, fa As Variant
Dim lngPOLsel, lngnonvop, lngSP, lngVOP As Long

Dim strcurrpath As String
strcurrpath = CurDir

SetCurDir ("\\Cls000008\actuarial_data\Xtractor")

strinputfile = Application.GetOpenFilename("Text Files (*.txt), *.txt", , "Select the input text file")


/// some more code

end sub


Many thanks !!:)

Hi,

Please Replace

Private Declare Function SetCurDir Lib "kernel32" Alias "SetCurrent[B]D[/B]irectoryA" (ByVal lpPathName As String) As Long

instead

Private Declare Function SetCurDir Lib "kernel32" _
Alias "SetCurrentdirectoryA" (ByVal lpPathName As String) As Long

The API function name(SetCurrentDirectoryA) is case sensitive.

I'm still getting this error message ... refer to my attachment !

Thanks

What was i thinking ??? Thanks selvaganapathy !!!!

It worked !!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.