Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cct cct is offline
external usenet poster
 
Posts: 2
Default Excel hang when SaveAs

Dear all,

My environment:-
Windows Server 2003
Office XP with SP3
dotnet 1.1 with SP1
ASP.net with VB Com dll.

The following code (in VB com dll) is working fine when Excel file is
without Macros :-

Set xlApp1 = New Excel.Application
xlApp1.EnableEvents = False
Set xlWBook = xlApp1.Workbooks.Open(sourcefile, False, , , Passwd)
xlApp1.EnableEvents = True

Dim filename As String
filename = "ABC.xls"

On Error Resume Next
Kill filename

Method #1:-
xlWBook.SaveAs filename, , "" -- No error, Excel hang in Task Manager

Method #2:-
xlApp1.EnableEvents = False
xlApp1.DisplayAlerts = False
xlWBook.SaveAs filename, , "" -- Error! Document not saved.

If I manually open the excel file through Excel Application, I am able to
save as another file without error.

Does anyone know how to fix this.
Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
cct cct is offline
external usenet poster
 
Posts: 2
Default Excel hang when SaveAs

Is it possible to delete/remove/disable macro when saveas?

Thanks.

"cct" wrote in message
...
Dear all,

My environment:-
Windows Server 2003
Office XP with SP3
dotnet 1.1 with SP1
ASP.net with VB Com dll.

The following code (in VB com dll) is working fine when Excel file is
without Macros :-

Set xlApp1 = New Excel.Application
xlApp1.EnableEvents = False
Set xlWBook = xlApp1.Workbooks.Open(sourcefile, False, , , Passwd)
xlApp1.EnableEvents = True

Dim filename As String
filename = "ABC.xls"

On Error Resume Next
Kill filename

Method #1:-
xlWBook.SaveAs filename, , "" -- No error, Excel hang in Task
Manager

Method #2:-
xlApp1.EnableEvents = False
xlApp1.DisplayAlerts = False
xlWBook.SaveAs filename, , "" -- Error! Document not saved.

If I manually open the excel file through Excel Application, I am able to
save as another file without error.

Does anyone know how to fix this.
Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Excel hang when SaveAs

Hi

Are you automation Excel in the Server side, i.e. in the ASP.NET code?
We did not recommend automation Office Product in serverside because office
product is designed for desktop interactive operation.
Here is a KB article for your reference.

This article discusses the complications that developers may face, offers
alternatives to Automation that can speed performance, and suggests ways to
configure Office if server-side Automation is unavoidable. Developers
should be aware, however, that the suggestions provided below are for
informational purposes only. Microsoft does not recommend or support
server-side Automation of Office.

NOTE: In this context, the term "server-side" also applies to code that is
running on a Microsoft Windows NT or Microsoft Windows 2000 workstation,
provided that it is running from a WinStation other than the interactive
station of the user that is logged on. For example, code that is started by
Task Scheduler under the SYSTEM account runs in the same environment as
"server-side" ASP or DCOM code, and therefore experiences many of the same
issues. For more information on WinStations and COM, see the "More
Information" and "References" sections.

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/default...b;en-us;257757


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

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
Application Hang with Excel Bennett Marco Excel Discussion (Misc queries) 6 November 5th 09 01:21 PM
Excel Application hang Ray Excel Discussion (Misc queries) 1 September 18th 09 12:53 AM
Excel Attachments Hang teenzbutler Excel Discussion (Misc queries) 1 March 30th 07 01:54 AM
excel hang inenewbl Excel Discussion (Misc queries) 1 July 13th 06 12:37 PM
Excel seems to hang and cause asp script to timeout. Justin Excel Programming 0 June 24th 05 04:14 PM


All times are GMT +1. The time now is 02:52 AM.

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

About Us

"It's about Microsoft Excel"