![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Owerwrite an Excel Topic Summary: Owerwrite an Excel Created On: 22-Jan-2009 12:21 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello,
If an excel file already exists in a windows location and I want to owerwrite that excel sheet without any confirmation message, how do I do it? when I use oleMethod(objSheet, "SaveAs", args) excel pops up an confirmation message saying "A File named FILENAME already exists in this location. Do you want to replace it?" with "YES" "NO" and "CANCEL" buttons. How to get rid of this message? Thanks & Regards Irfaan |
|
![]() |
|
![]() |
|
In dxl there is the hard way and then there is an easy way.
For now I will only tell you the easy way. Using dxl see if the file exists already -- if it exists then delete the file then execute a saveas. If this isn't sufficient for you then ask for the hard way and I will respond. |
|
![]() |
|
![]() |
|
Hi,
Yeah, I am aware of this idea. But this is an indirect way of doing it. Is there a direct way? I guess it is the hard way which you are talking about. :-) Irfaan |
|
![]() |
|
![]() |
|
Don't you love someone that is a purist and loves to do things the hard way. I actually harder method but after thinking about the question, I cam up with the easier solution.
Convert the following vba to dxl syntax to silence Excel messages. objExcel.DisplayAlerts = false Edited: 23-Jan-2009 at 15:01 by ron lewis |
|
![]() |
|
![]() |
|
You can use the "DisplayAlerts" property of the Excel application object. From the MSDN website:
So your code would need to change to something like this, replacing 'objExcel' with the variable that represents the Excel application in your code: olePut(objExcel, "DisplayAlerts", false) oleMethod(objSheet, "SaveAs", args) olePut(objExcel, "DisplayAlerts", true) -Dennis |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Owerwrite an Excel
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.