langthang084 Posted January 12, 2016 Share Posted January 12, 2016 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. Link to comment Share on other sites More sharing options...
jguinch Posted January 12, 2016 Share Posted January 12, 2016 What is the value of @error after this line ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
langthang084 Posted January 12, 2016 Author Share Posted January 12, 2016 @error = 5, @extend = - 2147352567 Link to comment Share on other sites More sharing options...
InunoTaishou Posted January 12, 2016 Share Posted January 12, 2016 (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 January 12, 2016 by InunoTaishou Link to comment Share on other sites More sharing options...
jguinch Posted January 12, 2016 Share Posted January 12, 2016 @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) langthang084 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
langthang084 Posted January 12, 2016 Author Share Posted January 12, 2016 Thanks Jguich! I work with Excel 2003 so change to $xlExcel7, then it run normally (also with $xlExcel3, $xlExcel5) Link to comment Share on other sites More sharing options...
langthang084 Posted January 13, 2016 Author Share Posted January 13, 2016 (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 January 13, 2016 by langthang084 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