langthang084

how to save files on LAN?

7 posts in this topic

I want to use _Excel_BookSaveAs with the path "\\10.0.4.191\AutoShare\New.xls" but Itnot work. 

_Excel_BookSaveAs ( $oWorkbook, "\\10.0.4.191\AutoShare\New.xls")

How to solved it!
Thanks all.

Share this post


Link to post
Share on other sites



@error = 5, @extend = - 2147352567

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$oWorkbook.SaveAs($sFilePath, $iFormat, $sPassword, $sWritePassword, $bReadOnlyRecommended)
    If @error Then Return SetError(5, @error, 0)

Looks like error 5 in the Excel.udf is error saving.

The max negative int value! Truly the most fearsome error code.

Edited by InunoTaishou

Share this post


Link to post
Share on other sites

@langthang084 : read the remarks section in the help page :

Starting with Excel 2007 you have to provide both the $iFormat parameter and the correct file extension in $sFilePath.
E.g. $iFormat = $xlExcel8 and extension = "xlsx" will return an error.
Please see the XlFileFormat enumeration in ExcelConstants.au3 for possible values.

Try to change the $iFormat parameter ($xlExcel8 seems to be what you need)

1 person likes this

Share this post


Link to post
Share on other sites

Thanks Jguich! I work with Excel 2003 so change to $xlExcel7, then it run normally (also with $xlExcel3, $xlExcel5)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I run on my laptop (dont save on LAN) it work normally, but on my computer at company, the excel has error in Unicode text and the sheet has been renamed (to Recovered_Sheet....)

Edited by langthang084

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