Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The sheet object does have a SaveAs method but I don't know why it exists
since it does the same thing as the workbook SaveAs method. It might be for backward compatibility purposes. I'd just use the workbook object and then you can use -4143. Btw, "1" is not among the xlFileFormat named constants although it does seem to result in a normal workbook. -- Jim "shrek" wrote in message ... | Hi all, | | I use the Excel from C++ via automation and I try use SaveAs method of the | WorkSheet object. The very strange thing is that it doesn't work with | "xlNormal" (that is -4143) or with "xlWorkbookNormal" (that is -4143 too) it | gives some back some error code (0x800a03ec). BUT is works with value 1 | which is mentioned nowhere in the documentation or in the type library. | | Can somebody tell me why "xlNormal" doesn't work with WorkSheet's SaveAs? | and what 1 means as file format constant? (it has to be some meaning because | Excel accept it) | | |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In fact this is not answer to my question bcz I knew these things before
too. You can use value 1 as fileformat constant in the SaveAs method of worksheet object and it works but -4143 doesn't. Below a code snippet ( vbscript), it works with 1 and doesn't work with -4143. Can somebody tell me why? const FileFormat = 1 Set theArgs = wscript.Arguments Set excelApp = Wscript.CreateObject("Excel.Application") excelApp.Workbooks.Open(theArgs(0)) Set WrkSht = excelApp.Worksheets(1) set range = wrksht.range("B1:D1") range.select excelApp.selection.mergecells = true wrksht.SaveAs theArgs(1), FileFormat excelApp.quit set excalApp = nothing "Jim Rech" wrote in message ... The sheet object does have a SaveAs method but I don't know why it exists since it does the same thing as the workbook SaveAs method. It might be for backward compatibility purposes. I'd just use the workbook object and then you can use -4143. Btw, "1" is not among the xlFileFormat named constants although it does seem to result in a normal workbook. -- Jim "shrek" wrote in message ... | Hi all, | | I use the Excel from C++ via automation and I try use SaveAs method of the | WorkSheet object. The very strange thing is that it doesn't work with | "xlNormal" (that is -4143) or with "xlWorkbookNormal" (that is -4143 too) it | gives some back some error code (0x800a03ec). BUT is works with value 1 | which is mentioned nowhere in the documentation or in the type library. | | Can somebody tell me why "xlNormal" doesn't work with WorkSheet's SaveAs? | and what 1 means as file format constant? (it has to be some meaning because | Excel accept it) | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 question involving SaveAs to .XLS | Excel Discussion (Misc queries) | |||
Saveas VBA question | Excel Discussion (Misc queries) | |||
SAveAs worksheet | Excel Worksheet Functions | |||
SaveAs Question | Excel Programming | |||
Question Using SaveAs Method | Excel Programming |