litlmike Posted April 22, 2008 Share Posted April 22, 2008 "The requested action with this object has failed"I get this message with the following code. I looked here for an example, and I can't find any place where i made a mistake (http://www.microsoft.com/technet/scriptcen...5/tips0607.mspx)Suggestions please. TIAConst $adOpenStatic = 3 Const $adLockOptimistic = 3 Const $adCmdText = 0x0001 ; =&H0001 Global $sFilePath1 = FileGetShortName(@ScriptDir & "\Stats.xls") Global $s_Tablename = "[Sheet1$]" ; $objConnection = ObjCreate("ADODB.Connection") $objRecordSet = ObjCreate("ADODB.Recordset") $objConnection.Open ("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source="&$sFilePath1&";" & _ "Extended Properties=""Excel 8.0;HDR=Yes;"";") $objRecordset.Open ("Select * FROM [Sheet1$] Where SiteName = Aventouras", $objConnection, $adOpenStatic, $adLockOptimistic, $adCmdText) _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
ResNullius Posted April 22, 2008 Share Posted April 22, 2008 You should add a custom COM error handler to aid in debugging,Look in the helpfile under Obj/Com Reference then the subtopic COM Error HandlingThat should give you more info about the root cause of your error. Link to comment Share on other sites More sharing options...
litlmike Posted April 22, 2008 Author Share Posted April 22, 2008 You should add a custom COM error handler to aid in debugging, Look in the helpfile under Obj/Com Reference then the subtopic COM Error Handling That should give you more info about the root cause of your error.Ah hah! That is what that stuff means. Okay so I stole this from one of ptrex's posts and here is the new code. I got the following errors, which didn't help me too much, but I figured out what the problem was either way. This line should have read (it was missing the ' ) $objRecordset.Open ("Select * FROM [Sheet1$] Where SiteName = 'Aventouras'", $objConnection, $adOpenStatic, $adLockOptimistic, $adCmdText)oÝ÷ Ú«¨µå{^Ç©µçZ㮺+ßw«×¬r¸©¶*'Ãh½©nz¯zwè®Þ¢¹¨êÞªè«yÚZ©µêìzºðw^±Êâ¦Ø¨ã¢zºçºfÞ®+ _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now