D
DynamiteSkippy
I am working in Access 2002 and have a module which abruptly began blowing
up. Testing proves futile since it doesn't compile successfully but instead
provides a mysterious message:
Invalid Procedure Call or Argument
There is no cursor or anything to point out the region of code causing the
error. My code is fairly naive at this point:
Option Explicit
Option Compare Database
Dim dbconn As New ADODB.Connection
Public MyAccount As String
Public MyTextQue As String
Public FullCycle As Boolean
Function Harvest(Name, URL, Tgt as string)
Dim i As Variant
' Prepare to open the web page
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate URL
Do Until Not .Busy
DoEvents
Loop
' Select and copy all of the data from the web page
s = ie.Document.body.innertext
end with 'ie
nstart = InStr(1, s, Tgt, vbTextCompare)
If nstart Then nstart = nstart + Len(Tgt)
nend = InStr(nstart, s, vbCrLf)
If nend < nstart + 2 Then nend = nstart + 9
If nend > nstart + 15 Then nend = nstart + 9
bl = Mid$(s, nstart, nend - nstart)
'Populate table
sql = "INSERT INTO tbl_XpLibnm (Dt, Acct, Acct_Nm, Acct_Bl,Cur_Lib)
" & _
"SELECT '" & Now & "' , '" & Name & "','" & _
1234 & "', '" & bl & "','" & lib & "'"
Set dbconn = CurrentProject.Connection
dbconn.Execute (sql)
' Close the internet explorer application and do cleanup
Set ie = Nothing
Set ipf = Nothing
Set lo = Nothing
End Function
Another peculiar occurance that seems to be related is that I am unable to
save the module and when attempted I recieve the error:
The save operation failed.
I have checked my reference libraries and have compared between a backed up
(working) copy of the db and there is no libref differences. I am utterly
bewildered by this error. Any thoughts?
up. Testing proves futile since it doesn't compile successfully but instead
provides a mysterious message:
Invalid Procedure Call or Argument
There is no cursor or anything to point out the region of code causing the
error. My code is fairly naive at this point:
Option Explicit
Option Compare Database
Dim dbconn As New ADODB.Connection
Public MyAccount As String
Public MyTextQue As String
Public FullCycle As Boolean
Function Harvest(Name, URL, Tgt as string)
Dim i As Variant
' Prepare to open the web page
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate URL
Do Until Not .Busy
DoEvents
Loop
' Select and copy all of the data from the web page
s = ie.Document.body.innertext
end with 'ie
nstart = InStr(1, s, Tgt, vbTextCompare)
If nstart Then nstart = nstart + Len(Tgt)
nend = InStr(nstart, s, vbCrLf)
If nend < nstart + 2 Then nend = nstart + 9
If nend > nstart + 15 Then nend = nstart + 9
bl = Mid$(s, nstart, nend - nstart)
'Populate table
sql = "INSERT INTO tbl_XpLibnm (Dt, Acct, Acct_Nm, Acct_Bl,Cur_Lib)
" & _
"SELECT '" & Now & "' , '" & Name & "','" & _
1234 & "', '" & bl & "','" & lib & "'"
Set dbconn = CurrentProject.Connection
dbconn.Execute (sql)
' Close the internet explorer application and do cleanup
Set ie = Nothing
Set ipf = Nothing
Set lo = Nothing
End Function
Another peculiar occurance that seems to be related is that I am unable to
save the module and when attempted I recieve the error:
The save operation failed.
I have checked my reference libraries and have compared between a backed up
(working) copy of the db and there is no libref differences. I am utterly
bewildered by this error. Any thoughts?