Jump to content

_Excel_RangeInsert error ... ?


Recommended Posts

I'm trying the Excel.udf, my starting point are the examples found in the help.

My problem is that i can't find any working example of _Excel_RangeInsert ... made many tries but i can't find the reason why ...

New/existing Worbook nothing changes ... i tried _Excel_RangeWrite without any problem, but with _Excel_RangeInsert i always get an @error=3 and @extended=-2147352562 ...

What could i be missing ?

Here's the minimalistic snippet i'm playing with :

Local $sWorkbook = @ScriptDir & "\pixel.xls"
Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel ...", "Error opening '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

$dummy=_Excel_RangeInsert($oWorkbook.Activesheet, "1:3")
If @error Then
   $a=@extended
   MsgBox($MB_SYSTEMMODAL, "Excel ...", "Error inserting" & @CRLF & "@error = " & @error & ", @extended = " & @extended)
Else
   MsgBox($MB_SYSTEMMODAL, "Excel ...", "Rows successfully inserted")
EndIf

ConsoleWrite ($dummy & chr(13) & $a & Chr(13))

I tried every possible (...) syntax for the range object, without success ... 

I use the latest releases of AutoIt and Office 97 ...

Thanks for your help ...

Link to comment
Share on other sites

Works fine here with AutoIt 3.3.12.0 and Excel 2010.

the value of @extended stands for: 0x8002000E - DISP_E_BADPARAMCOUNT - invalid number of parameters.

As the Excel UDF has been tested with Excel 2003 and later I'm sure Excel 97 does not support a parameter passed by the UDF.
I fear you need to switch to a newer version of Excel or use the old Excel UDF that comes with AutoIt 3.3.8.1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...