Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel workbook.saveas freezes program

In C# I create and open an excel spreadsheet, populate it with data,
and then attempt to save it. This all works fine on my XP SP2 machine
with Excel 2003. However when I try to run it on Windows 2000 with
Excel 2000, the code gets stuck on _wb.Saveas (see code snippet below).

_app = new Excel.Application();
_wb = _app.Workbooks.Add(Type.Missing);
_ws = (Excel._Worksheet) _wb.Sheets.get_Item(1);

//populate the worksheet with data

_wb.SaveAs(aFileName, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing, Type.Missing,
Type.Missing, Type.Missing,Type.Missing);

Thanks,
Ryan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel workbook.saveas freezes program

Ryan,
Excel 2K only has 10 arguments to .SaveAs., but it appears Excel 2003 has
12.
You should make your code compatible with the oldest version you intend to
support.

NickHK

"Ryan" wrote in message
oups.com...
In C# I create and open an excel spreadsheet, populate it with data,
and then attempt to save it. This all works fine on my XP SP2 machine
with Excel 2003. However when I try to run it on Windows 2000 with
Excel 2000, the code gets stuck on _wb.Saveas (see code snippet below).

_app = new Excel.Application();
_wb = _app.Workbooks.Add(Type.Missing);
_ws = (Excel._Worksheet) _wb.Sheets.get_Item(1);

//populate the worksheet with data

_wb.SaveAs(aFileName, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing, Type.Missing,
Type.Missing, Type.Missing,Type.Missing);

Thanks,
Ryan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel workbook.saveas freezes program

Sorry this issue got sidetracked.

Thanks alot, that is the problem.

Do you know if there's somewhere that I can find documentation about
the differences between the versions of office from a programmer's
perspective?

Thanks.

NickHK wrote:
Ryan,
Excel 2K only has 10 arguments to .SaveAs., but it appears Excel 2003 has
12.
You should make your code compatible with the oldest version you intend to
support.

NickHK

"Ryan" wrote in message
oups.com...
In C# I create and open an excel spreadsheet, populate it with data,
and then attempt to save it. This all works fine on my XP SP2 machine
with Excel 2003. However when I try to run it on Windows 2000 with
Excel 2000, the code gets stuck on _wb.Saveas (see code snippet below).

_app = new Excel.Application();
_wb = _app.Workbooks.Add(Type.Missing);
_ws = (Excel._Worksheet) _wb.Sheets.get_Item(1);

//populate the worksheet with data

_wb.SaveAs(aFileName, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing, Type.Missing,
Type.Missing, Type.Missing,Type.Missing);

Thanks,
Ryan


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
office program freezes for about 1 min when doing a save as Rich Excel Discussion (Misc queries) 0 April 16th 10 07:06 AM
Multiple tab workbook freezes during editing Down to my last nerve Excel Discussion (Misc queries) 1 February 16th 10 03:01 PM
Excel workboox.saveas freezes program Ryan[_12_] Excel Programming 1 July 19th 06 05:29 PM
When i delete rows the program freezes tonyswin Excel Discussion (Misc queries) 0 May 4th 06 05:05 PM
Using custom template with Excel.Workbook.SaveAs [email protected] Excel Programming 1 January 28th 05 04:16 AM


All times are GMT +1. The time now is 04:28 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"