Sign in to follow this  
Followers 0
Akshay07

File saved without ".xls" extension when using _ExcelBookSaveAs

3 posts in this topic

Hi all,

Here is the piece of code:

$sPath = "C:\test\"&$sTime ; $sTime format is yy.mm.dd-hh.mm.ss
; Run("notepad.exe")
; Sleep(1000)
; Send($sPath)  This is just for testing purpose, to check that $sPath string is correct
$oExcel = _ExcelBookOpen("C:\test\ExcelTest.xls")
_ExcelBookSaveAs($oExcel, $sPath, "xls")

But the file is saved without any extension at all. According to the help, the format to use is _ExcelBookSaveAs($oExcel, $sFilePath, $sType = "xls").

Any clue?

Thanks

Share this post


Link to post
Share on other sites



Hi, i can't test your code because i don't have Excel.. But i think i know how to do it.. Maybe you can use this simple code:

_ExcelBookSaveAs($oExcel, $sPath & $Filename & ".xls", "xls")

;)


[size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size]

Share this post


Link to post
Share on other sites

Thanks, it works.

This is weird because it does not correspond to what the help says.

Anyway, as long as it works, I am happy ;)

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  
Followers 0