Bypassing prompts in a macro?

jjacks60

New Member
Joined
Jul 28, 2014
Messages
40
Currently I have a macro that runs and updates a master file grabbing information from excel sheets on sharedrives.
How would one bypass prompts that aren't simply yes/no - One asks to update the information from the external file, and one prompt says its a different size than the clipboard the information is being copied to.

I want to bypass both of these prompts, and I think Boolean values would be involved I just wanted sure if True and False worked for prompts other than yes/no.

And if it's unable to update the data I wanted to add an IF Error to notify the user the data did not update.

Here's the macro in its current state - I assume the prompts for Boolean values would go after I set the wbk?:

HTML:
Sub CpyProdSch()    
   Dim wbk As Workbook    
   Dim strFileName As String    
   Dim strFilePath As String
  
   strFilePath = "\\Ykf001\grpdata\PUBLIC\Operations\Converting Schedule\"  'constant    
   strFileName = Dir(strFilePath)        
   Set wbk = Workbooks.Open(strFilePath & strFileName, , True)        

   Worksheets(1).Activate        
       cells.Select        
       Range("BM1").Activate        
       Selection.Copy    
   Windows("Raw Data pRODUCTION.xlsx").Activate        
       Range("A1:C1").Select        
       Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _            
       xlNone, SkipBlanks:=False, Transpose:=False    
   wbk.Close False    
   Set wbk = Nothing
End Sub
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If you simply don't want the alerts displayed at all:

application.screenupdating = false (optional)
application.displayalerts = false
 
Upvote 0
If you simply don't want the alerts displayed at all:

application.screenupdating = false (optional)
application.displayalerts = false

The prompt is saying some contain links from other workbooks, then asks if I'd like to continue. If bypassing the prompt does the trick then easy fix.
 
Upvote 0

Forum statistics

Threads
1,196,516
Messages
6,015,664
Members
441,914
Latest member
VBAllTheThings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top