Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
Hi,
Does anyone know what VBA command I could insert into my Macro that would automatically select "yes" or "no" to an Excel pop-up window? So for example, I have a Macro which opens and closed workbooks and moves data from one workbook to another. In the process, I'll get an Excel window, which asks "do you want to save" (or something along those lines). I then click "No" and the Macro continues along its merry way. I was wondering if I could insert VBA code at that junction which would automatically select "No" to that prompt. Please advise. Thanks, Manuel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
Hi Manuel
If you use this for example the workbook will be closed without saving ThisWorkbook.Close SaveChanges:=False -- Regards Ron de Bruin http://www.rondebruin.nl "Manuel" wrote in message ... Hi, Does anyone know what VBA command I could insert into my Macro that would automatically select "yes" or "no" to an Excel pop-up window? So for example, I have a Macro which opens and closed workbooks and moves data from one workbook to another. In the process, I'll get an Excel window, which asks "do you want to save" (or something along those lines). I then click "No" and the Macro continues along its merry way. I was wondering if I could insert VBA code at that junction which would automatically select "No" to that prompt. Please advise. Thanks, Manuel |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
Hi Manuel
You don't reply to a popup like that, you make sure there are none. Like this: Application.DisplayAlerts = False 'your code here Application.DisplayAlerts = True HTH. Best wishes Harald "Manuel" skrev i melding ... Hi, Does anyone know what VBA command I could insert into my Macro that would automatically select "yes" or "no" to an Excel pop-up window? So for example, I have a Macro which opens and closed workbooks and moves data from one workbook to another. In the process, I'll get an Excel window, which asks "do you want to save" (or something along those lines). I then click "No" and the Macro continues along its merry way. I was wondering if I could insert VBA code at that junction which would automatically select "No" to that prompt. Please advise. Thanks, Manuel |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
It is possible to set the default value to no in the msgbox
The msg box definition is then MsgBox("Do you want to save?", vbYesNo + vbDefaultButton2, "test1") Greetz Ikke "Manuel" schreef in bericht ... Hi, Does anyone know what VBA command I could insert into my Macro that would automatically select "yes" or "no" to an Excel pop-up window? So for example, I have a Macro which opens and closed workbooks and moves data from one workbook to another. In the process, I'll get an Excel window, which asks "do you want to save" (or something along those lines). I then click "No" and the Macro continues along its merry way. I was wondering if I could insert VBA code at that junction which would automatically select "No" to that prompt. Please advise. Thanks, Manuel |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
Thanks, your suggestion may work for one part of the macro, but not for
others. Let me explain. The macro pulls (copies then pastes) data from text files, then closes said text files. 3 times while running the macro I receive the following message: 'FILE NAME' is not in Microsoft Excel 97 format. Do you want to save your changes? I manually click NO to these prompts. I also receive a message that says the following: A file named 'File Name' already exists in this location. Do you want to replace it? I manually click YES to this prompt (it's necessary that this particular file is overwritten each time the macro runs). So turning off the displays for the 1st message would probably resolve prompt 1, but at prompt 2 I want to be able to click YES to overlay the file, and I don't believe removing the prompts would accomplish this, or would it? I appreciate any help you can provide. Manuel *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
Thanks for the suggestion, but I don't think it'll suit my needs. Let
me explain further, as I wasn't very clear before. The macro pulls (copies then pastes) data from text files, then closes said text files. 3 times while running the macro I receive the following message: 'FILE NAME' is not in Microsoft Excel 97 format. Do you want to save your changes? I manually click NO to these prompts. I also receive a message that says the following: A file named 'File Name' already exists in this location. Do you want to replace it? I manually click YES to this prompt (it's necessary that this particular file is overwritten each time the macro runs). So I'm not sure the command you suggested would work becaue I'm dealing with closing text files after I've imported data into Excel, and not Workbooks. Do you have any other suggestion? I appreciate any help you can provide. Manuel *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
"Manuel Soares" skrev i melding
... 'FILE NAME' is not in Microsoft Excel 97 format. Do you want to save your changes? I manually click NO to these prompts. Hi Manuel The correct syntax is impossible to guess without seeing your code, but I'll try. Put Workbooks("FILE NAME").Saved = True immediately before Workbooks("FILE NAME").Close I also receive a message that says the following: A file named 'File Name' already exists in this location. Do you want to replace it? I manually click YES to this prompt (it's necessary that this particular file is overwritten each time the macro runs). Application.DisplayAlerts = False 'either : Workbooks("FILE NAME").Save 'or : Workbooks("WHATEVER").SaveAs "FILE NAME" Application.DisplayAlerts = True Workbooks("FILE NAME").Close Don't just participate in USENET...get rewarded for it! You get paid for receiving our free assistance ? HTH. Best wishes Harald |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA command to say "yes"/"no" to popup window
"Manuel Soares" wrote in message ... Thanks for the suggestion, but I don't think it'll suit my needs. Let me explain further, as I wasn't very clear before. The macro pulls (copies then pastes) data from text files, then closes said text files. 3 times while running the macro I receive the following message: 'FILE NAME' is not in Microsoft Excel 97 format. Do you want to save your changes? I manually click NO to these prompts. I also receive a message that says the following: A file named 'File Name' already exists in this location. Do you want to replace it? I manually click YES to this prompt (it's necessary that this particular file is overwritten each time the macro runs). So I'm not sure the command you suggested would work becaue I'm dealing with closing text files after I've imported data into Excel, and not Workbooks. Do you have any other suggestion? I appreciate any help you can provide. Manuel You can suppress these messages by using the command Application.DisplayAlerts = False dont forget to turn them on again when you are done :) Keith ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
freeze window creates multiple "views" suffixed with ":n" | Excel Discussion (Misc queries) |