Jump to content

Excel UDF Saveas Help


Vebra
 Share

Recommended Posts

I'm writing a script that takes user input, puts it in an excel file, and mails it off. I have it all working except when it gets run from a flash drive. Here is the offending line of code I believe:

_ExcelBookSaveAs($oExcel.Application, "Medical", "xls", 0, 0, "password", "password")

I did have it where it says Medical I did have the path and all that, it just did the same thing.

And here's my error:

C:\Program Files\AutoIt3\Include\Excel.au3 (348) : ==> The requested action with this object has failed.:
If $sPassword <> "" And $sWritePassword = "" Then $oExcel.ActiveWorkBook.SaveAs($sFilePath, $sType, $sPassword, Default, Default, Default, $iAccessMode, $iConflictResolution)
If $sPassword <> "" And $sWritePassword = "" Then $oExcel.ActiveWorkBook.SaveAs($sFilePath, $sType, $sPassword, Default, Default, Default, $iAccessMode, $iConflictResolution)^ ERROR
>Exit code: 1    Time: 19.529
Link to comment
Share on other sites

That originally how it was. I did it again. It worked the first time around, and not again after that. That was the same deal with the way it is now. Works the first time I run the code, then I get the errors when I try to run it a second time for good measure.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...