Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default worksheet saveas question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default worksheet saveas question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 question involving SaveAs to .XLS Kirk Bubul Excel Discussion (Misc queries) 3 October 17th 09 03:01 PM
Saveas VBA question Lost Excel Discussion (Misc queries) 1 June 2nd 09 07:51 AM
SAveAs worksheet Brian Young Excel Worksheet Functions 14 October 25th 06 12:21 PM
SaveAs Question Greg Little Excel Programming 3 December 7th 04 02:37 AM
Question Using SaveAs Method R3df1sh Excel Programming 1 November 12th 03 07:26 PM


All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"