Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default excel saving exception in vc code

I save a excel file using vc code, when the file is aready exsited, a
dialogue box appears with three choices--yes, no or cancel--for me to decide
whether to cover the exsited file or not. If I choose yes, it runs well. But
when I choose ¡°no¡± or ¡°cancel¡±, an exception happens--a messagebox
without any words appeares and the excel file doesn¡¯t exit.

Why does this happen? Can anyone help me?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default excel saving exception in vc code

Do you always want to save the file?

Application.displayalerts = false
'your code to save the workbook
application.displayalerts = true



onlyfang wrote:

I save a excel file using vc code, when the file is aready exsited, a
dialogue box appears with three choices--yes, no or cancel--for me to decide
whether to cover the exsited file or not. If I choose yes, it runs well. But
when I choose ¡°no¡± or ¡°cancel¡±, an exception happens--a messagebox
without any words appeares and the excel file doesn¡¯t exit.

Why does this happen? Can anyone help me?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default excel saving exception in vc code

ps. I don't speak the VC code. You'll have to interpret it.

Dave Peterson wrote:

Do you always want to save the file?

Application.displayalerts = false
'your code to save the workbook
application.displayalerts = true

onlyfang wrote:

I save a excel file using vc code, when the file is aready exsited, a
dialogue box appears with three choices--yes, no or cancel--for me to decide
whether to cover the exsited file or not. If I choose yes, it runs well. But
when I choose ¡°no¡± or ¡°cancel¡±, an exception happens--a messagebox
without any words appeares and the excel file doesn¡¯t exit.

Why does this happen? Can anyone help me?


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default excel saving exception in vc code

Oh, thank you very much, Dave! The problem has been solved!
Yes, i always want to save the file, and the counterpart code in vc is
"Application.SetDisplayAlerts(false)".
Thank you!

"Dave Peterson"
...
ps. I don't speak the VC code. You'll have to interpret it.

Dave Peterson wrote:

Do you always want to save the file?

Application.displayalerts = false
'your code to save the workbook
application.displayalerts = true

onlyfang wrote:

I save a excel file using vc code, when the file is aready exsited, a
dialogue box appears with three choices--yes, no or cancel--for me to
decide
whether to cover the exsited file or not. If I choose yes, it runs
well. But
when I choose ¡°no¡± or ¡°cancel¡±, an exception happens--a messagebox
without any words appeares and the excel file doesn¡¯t exit.

Why does this happen? Can anyone help me?


--

Dave Peterson


--

Dave Peterson



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
How to code on Macro on saving and closing a file? Eric Excel Worksheet Functions 1 June 10th 07 01:32 PM
Saving a CSV file from Excel with 0 in front of Zip code ChuckW Excel Discussion (Misc queries) 10 June 8th 06 06:35 PM
I don't want to run visual basic editer code after saving... areddy Excel Discussion (Misc queries) 1 October 26th 05 01:57 PM
Saving Vba Code Rick, United Kingdom Excel Discussion (Misc queries) 5 September 8th 05 08:51 PM
How do I retain leading zero zip code formatting when saving as a. RodFCIS Excel Discussion (Misc queries) 7 January 25th 05 07:29 PM


All times are GMT +1. The time now is 03:35 PM.

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"