Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SaveAs Result?

I'm having trouble with adding a feature to prompt the user to save the file
under a different name. I need it to force the user to save it. The
trouble is that if the user chooses a file name that exists he/she is asked
to overwrite the file or not. If I choose 'No' or 'Cancel' it creates an
error. I can trap the error and try to resume but all this does is loop
through the overwrite prompt, effectively forcing the user to overwrite the
file.

Is there a method to determine and handle the output from the overwrite
dialog, make choices based on which button was pressed?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SaveAs Result?

Use GetSaveAsFilename to put up your own prompt for the filename. Then you
can also manage overwriting and the user's response.

--
Regards,
Tom Ogilvy

"Shawn Shuler" wrote in message
...
I'm having trouble with adding a feature to prompt the user to save the

file
under a different name. I need it to force the user to save it. The
trouble is that if the user chooses a file name that exists he/she is

asked
to overwrite the file or not. If I choose 'No' or 'Cancel' it creates an
error. I can trap the error and try to resume but all this does is loop
through the overwrite prompt, effectively forcing the user to overwrite

the
file.

Is there a method to determine and handle the output from the overwrite
dialog, make choices based on which button was pressed?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SaveAs Result?

I am doing that but it still uses the standard Save As dialog box. If I
were to change the filename in there to one that exists I end up in the same
place with the same problem. Is there no way to determine which button (Ok,
No, Cancel) is pressed and then handle each possible choice?

"Shawn Shuler" wrote in message
...
I'm having trouble with adding a feature to prompt the user to save the

file
under a different name. I need it to force the user to save it. The
trouble is that if the user chooses a file name that exists he/she is

asked
to overwrite the file or not. If I choose 'No' or 'Cancel' it creates an
error. I can trap the error and try to resume but all this does is loop
through the overwrite prompt, effectively forcing the user to overwrite

the
file.

Is there a method to determine and handle the output from the overwrite
dialog, make choices based on which button was pressed?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SaveAs Result?

GetSaveAsFileName may show the saveas dialog, but it doesn't attempt to save
the file. You do that with your code. If you are doing that, then you
should be able to add code to deal with an existing file name. If excel is
putting up the dialog, then there is no way to determine what the user has
answered. But as I said, you can write your code so Excel doesn't put up
the dialog.

--
Regards,
Tom Ogilvy


"Shawn Shuler" wrote in message
...
I am doing that but it still uses the standard Save As dialog box. If I
were to change the filename in there to one that exists I end up in the

same
place with the same problem. Is there no way to determine which button

(Ok,
No, Cancel) is pressed and then handle each possible choice?

"Shawn Shuler" wrote in message
...
I'm having trouble with adding a feature to prompt the user to save the

file
under a different name. I need it to force the user to save it. The
trouble is that if the user chooses a file name that exists he/she is

asked
to overwrite the file or not. If I choose 'No' or 'Cancel' it creates

an
error. I can trap the error and try to resume but all this does is loop
through the overwrite prompt, effectively forcing the user to overwrite

the
file.

Is there a method to determine and handle the output from the overwrite
dialog, make choices based on which button was pressed?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default SaveAs Result?

Hmmmm, I see what you are saying. I'll have to look again (have to actually
work for money right now) when I get home. I may just be handling things in
a bad sequence (determining WHERE to save the file too late in the process).
I'll take a fresh look at it this afternoon. I appreciate the help.

"Tom Ogilvy" wrote in message
...
GetSaveAsFileName may show the saveas dialog, but it doesn't attempt to

save
the file. You do that with your code. If you are doing that, then you
should be able to add code to deal with an existing file name. If excel

is
putting up the dialog, then there is no way to determine what the user has
answered. But as I said, you can write your code so Excel doesn't put up
the dialog.

--
Regards,
Tom Ogilvy


"Shawn Shuler" wrote in message
...
I am doing that but it still uses the standard Save As dialog box. If I
were to change the filename in there to one that exists I end up in the

same
place with the same problem. Is there no way to determine which button

(Ok,
No, Cancel) is pressed and then handle each possible choice?

"Shawn Shuler" wrote in message
...
I'm having trouble with adding a feature to prompt the user to save

the
file
under a different name. I need it to force the user to save it. The
trouble is that if the user chooses a file name that exists he/she is

asked
to overwrite the file or not. If I choose 'No' or 'Cancel' it creates

an
error. I can trap the error and try to resume but all this does is

loop
through the overwrite prompt, effectively forcing the user to

overwrite
the
file.

Is there a method to determine and handle the output from the

overwrite
dialog, make choices based on which button was pressed?








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
vlookup shows result one cell above the expected result Marie Excel Worksheet Functions 7 November 14th 06 02:52 AM
excel result return wrong calcuation result garyww Excel Worksheet Functions 1 August 14th 06 11:14 AM
excel result return wrong calcuation result garyww Excel Worksheet Functions 0 August 14th 06 05:02 AM
Advanced formula - Return result & Show Cell Reference of result Irv Excel Worksheet Functions 7 May 6th 06 03:36 AM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM


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