Jump to content
Sign in to follow this  
Gerry

Excel UDF

Recommended Posts

Gerry

Hi All

I am writting a program and make extensive use of the Excelcom_UDF. I know there are a few variations available and found the latest version which came with the December update of AutoIt. The new version does not seem to have all the commands found in the Excelcom_UDF, therefore looks like I am stuck to it.

I have intermittant ptoblems using Excelcom_UDF with the same error coming up in different parts of my script.

The error I get is this:

C:\Program Files\AutoIt3\Include\ExcelCom_UDF.au3 (2257) : ==> The requested action with this object has failed.:

Local $iTemp = $oExcel.ActiveWorkbook.Sheets.Count

Local $iTemp = $oExcel.ActiveWorkbook^ ERROR

At first I thought the word "sheets" may be miss-spelled in the ExcelCom_UDF and changed it tempory to check but that did not do it, so I changed it back.

I am using Office 2003 and XP Pro, SP3. I have loaded the office update to enable me to open Office 2007 files.

Something else, I assume the Excel udf as found with the latest release will soon be updated to have the commands found in the older ExcelCom_UDF? Could one merge the two UDF's or should one include both UDF's?

Lastly, am I posting to the correct forum or should I rather be sending this to the place where I downloaded the ExcelCom_UDF for assistance or bug report?

Sorry to have bugged you guys but I hope someone has some answers to this.

Gerry

Share this post


Link to post
Share on other sites
someone

Your in the right place. As for a merging of all the functions found in the non-included UDF with the included one.. I'm not sure, I'm sure its on someones plate somewhere but I couldn't give you any kind of timetable. If you are able to help post a message (or maybe a PM if you don't get a responce) in the ExcelCom_UDF topic. You can merge, include both or do whatever you want, but if you try to include both you may get some errors as some functions will be included in one AND the other.

As for your error, we need you to include the code you are running (small snippet if possible), not just where the excel UDF is failing. Also, try registering a COM error handler, and see if that can shed more light on your issue. For that, check out ObjEvent in the help file. The example uses an error handler. For more general info on it go to Obj/COM Reference in the help file.

If using the error handler doesn't help, post your code and what the error message is from the error handler.


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
PsaltyDS

Hi All

I am writting a program and make extensive use of the Excelcom_UDF. I know there are a few variations available and found the latest version which came with the December update of AutoIt. The new version does not seem to have all the commands found in the Excelcom_UDF, therefore looks like I am stuck to it.

I have intermittant ptoblems using Excelcom_UDF with the same error coming up in different parts of my script.

The error I get is this:

C:\Program Files\AutoIt3\Include\ExcelCom_UDF.au3 (2257) : ==> The requested action with this object has failed.:

Local $iTemp = $oExcel.ActiveWorkbook.Sheets.Count

Local $iTemp = $oExcel.ActiveWorkbook^ ERROR

At first I thought the word "sheets" may be miss-spelled in the ExcelCom_UDF and changed it tempory to check but that did not do it, so I changed it back.

I am using Office 2003 and XP Pro, SP3. I have loaded the office update to enable me to open Office 2007 files.

Something else, I assume the Excel udf as found with the latest release will soon be updated to have the commands found in the older ExcelCom_UDF? Could one merge the two UDF's or should one include both UDF's?

Lastly, am I posting to the correct forum or should I rather be sending this to the place where I downloaded the ExcelCom_UDF for assistance or bug report?

Sorry to have bugged you guys but I hope someone has some answers to this.

Gerry

Post a short reproducer script to demonstrate your error. This works fine for me:
#include <ExcelCOM_UDF.au3>
#include <Array.au3>

$oExcel = _ExcelBookNew()

$avSheets = _ExcelSheetList($oExcel)
$iErrSav = @error
If IsArray($avSheets) Then
    _ArrayDisplay($avSheets, "$avSheets, @error = " & $iErrSav)
Else
    MsgBox(16, "Error", "_ExcelSheetList() failed, @error = " & $iErrSav)
    Exit
EndIf

_ExcelSheetDelete($oExcel, $avSheets[1])

$avSheets = _ExcelSheetList($oExcel)
$iErrSav = @error
If IsArray($avSheets) Then
    _ArrayDisplay($avSheets, "$avSheets, @error = " & $iErrSav)
Else
    MsgBox(16, "Error", "_ExcelSheetList() failed, @error = " & $iErrSav)
    Exit
EndIf

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Gerry

Hi All

Thanks for all who responded.

I have thought the matter over and it would perhaps be better to use just he Excel udf distributed with the new version.

I am no good with arrays but I will have to jack my self up on that. If I read all the spreadsheets in to an few arrays, I can work on that and when fished just dump the whole lot back to the spreadsheet, should be faster too . . .

Thanks again

Gerry

Share this post


Link to post
Share on other sites
PsaltyDS

Hi All

Thanks for all who responded.

I have thought the matter over and it would perhaps be better to use just he Excel udf distributed with the new version.

I am no good with arrays but I will have to jack my self up on that. If I read all the spreadsheets in to an few arrays, I can work on that and when fished just dump the whole lot back to the spreadsheet, should be faster too . . .

Thanks again

Gerry

Right on both counts. Arrays are so useful that they are well worth the initial learning curve. And getting you data into memory for operations, then writing it all back once should be much faster.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  

×