PC Review


Reply
Thread Tools Rate Thread

Dialog Box pauses my process

 
 
liam.mccartney
Guest
Posts: n/a
 
      17th Jun 2009
Using a macro I'm pasting in a large amount of data from one workbook to
another which is then delimited by comma. Since I'm repeating this process
many times the data delimits over old data previously entered. When this
happens excel asks if I want to overwrite on the destination cells which
pauses the automated process

So my question is: how do I program my macro to tell Excel yes when this
dialog box comes up? It would expedite this quite a bit.

Here is my code as of now:

Dim i As Integer
Dim filearray As Variant

filearray = Application.GetOpenFilename(Title:="(*.epw)", MultiSelect:=True)
If IsArray(filearray) Then
For i = LBound(filearray) To UBound(filearray)
Workbooks.Open filearray(i)
Range("A1:A8768").Select
Selection.Copy
Windows("Analysis truncated.xls").Activate
Sheets("Raw Data").Activate
Range("A1").Select
ActiveSheet.Paste
Selection.TextToColumns
Application.CutCopyMode = False
Windows("Analysis truncated.xls").Activate
Sheets("TMY Analysis 3-6").Range("A2:I2").EntireRow.Copy
Sheets("Weather
Stations").Range("A65536").End(xlUp)(2).EntireRow.PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next i
Else:
MsgBox "End"
End If

Thank you!

 
Reply With Quote
 
 
 
 
EricG
Guest
Posts: n/a
 
      17th Jun 2009
Try wrapping your code with these two statements. They turn off certain
warnings in Excel, so you should not see the dialog box. I haven't tried it
for your case, so I'm not 100% sure it will work.

Application.DisplayAlerts = False ' Turn off Excel warnings...
....your code here
Application.DisplayAlerts = True ' Turn them back on when done

HTH,

Eric

"liam.mccartney" wrote:

> Using a macro I'm pasting in a large amount of data from one workbook to
> another which is then delimited by comma. Since I'm repeating this process
> many times the data delimits over old data previously entered. When this
> happens excel asks if I want to overwrite on the destination cells which
> pauses the automated process
>
> So my question is: how do I program my macro to tell Excel yes when this
> dialog box comes up? It would expedite this quite a bit.
>


 
Reply With Quote
 
liam.mccartney
Guest
Posts: n/a
 
      17th Jun 2009
Wow, that worked beautifully!

Thank's so much.



"EricG" wrote:

> Try wrapping your code with these two statements. They turn off certain
> warnings in Excel, so you should not see the dialog box. I haven't tried it
> for your case, so I'm not 100% sure it will work.
>
> Application.DisplayAlerts = False ' Turn off Excel warnings...
> ...your code here
> Application.DisplayAlerts = True ' Turn them back on when done
>
> HTH,
>
> Eric
>
> "liam.mccartney" wrote:
>
> > Using a macro I'm pasting in a large amount of data from one workbook to
> > another which is then delimited by comma. Since I'm repeating this process
> > many times the data delimits over old data previously entered. When this
> > happens excel asks if I want to overwrite on the destination cells which
> > pauses the automated process
> >
> > So my question is: how do I program my macro to tell Excel yes when this
> > dialog box comes up? It would expedite this quite a bit.
> >

>

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      17th Jun 2009
Application.AlertBeforeOverwriting = False

'Code to add data

Application.AlertBeforeOverwriting = True


"liam.mccartney" <(E-Mail Removed)> wrote in message
news:60979784-0210-4BB8-937C-(E-Mail Removed)...
> Using a macro I'm pasting in a large amount of data from one workbook to
> another which is then delimited by comma. Since I'm repeating this
> process
> many times the data delimits over old data previously entered. When this
> happens excel asks if I want to overwrite on the destination cells which
> pauses the automated process
>
> So my question is: how do I program my macro to tell Excel yes when this
> dialog box comes up? It would expedite this quite a bit.
>
> Here is my code as of now:
>
> Dim i As Integer
> Dim filearray As Variant
>
> filearray = Application.GetOpenFilename(Title:="(*.epw)",
> MultiSelect:=True)
> If IsArray(filearray) Then
> For i = LBound(filearray) To UBound(filearray)
> Workbooks.Open filearray(i)
> Range("A1:A8768").Select
> Selection.Copy
> Windows("Analysis truncated.xls").Activate
> Sheets("Raw Data").Activate
> Range("A1").Select
> ActiveSheet.Paste
> Selection.TextToColumns
> Application.CutCopyMode = False
> Windows("Analysis truncated.xls").Activate
> Sheets("TMY Analysis 3-6").Range("A2:I2").EntireRow.Copy
> Sheets("Weather
> Stations").Range("A65536").End(xlUp)(2).EntireRow.PasteSpecial
> Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
> :=False, Transpose:=False
> Next i
> Else:
> MsgBox "End"
> End If
>
> Thank you!
>



 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      17th Jun 2009
I never knew that specific property existed - I learn something new here
every day!

Eric

"JLGWhiz" wrote:

> Application.AlertBeforeOverwriting = False
>
> 'Code to add data
>
> Application.AlertBeforeOverwriting = True
>
>
> "liam.mccartney" <(E-Mail Removed)> wrote in message
> news:60979784-0210-4BB8-937C-(E-Mail Removed)...
> > Using a macro I'm pasting in a large amount of data from one workbook to
> > another which is then delimited by comma. Since I'm repeating this
> > process
> > many times the data delimits over old data previously entered. When this
> > happens excel asks if I want to overwrite on the destination cells which
> > pauses the automated process
> >
> > So my question is: how do I program my macro to tell Excel yes when this
> > dialog box comes up? It would expedite this quite a bit.
> >
> > Here is my code as of now:
> >
> > Dim i As Integer
> > Dim filearray As Variant
> >
> > filearray = Application.GetOpenFilename(Title:="(*.epw)",
> > MultiSelect:=True)
> > If IsArray(filearray) Then
> > For i = LBound(filearray) To UBound(filearray)
> > Workbooks.Open filearray(i)
> > Range("A1:A8768").Select
> > Selection.Copy
> > Windows("Analysis truncated.xls").Activate
> > Sheets("Raw Data").Activate
> > Range("A1").Select
> > ActiveSheet.Paste
> > Selection.TextToColumns
> > Application.CutCopyMode = False
> > Windows("Analysis truncated.xls").Activate
> > Sheets("TMY Analysis 3-6").Range("A2:I2").EntireRow.Copy
> > Sheets("Weather
> > Stations").Range("A65536").End(xlUp)(2).EntireRow.PasteSpecial
> > Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
> > :=False, Transpose:=False
> > Next i
> > Else:
> > MsgBox "End"
> > End If
> >
> > Thank you!
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show Dialog windows from child process Sudeep Microsoft C# .NET 0 2nd Apr 2009 05:52 AM
Pauses then starts and then pauses jmo234@gmail.com Microsoft Excel Discussion 0 14th Jan 2008 07:19 AM
Process.Start suppress print dialog box =?Utf-8?B?VG9kZE0=?= Microsoft C# .NET 0 9th Apr 2007 09:24 PM
Automated process hanging waiting for dialog Benny Microsoft C# .NET 3 6th Mar 2006 09:22 PM
Random process pauses??? Noozer Computer Hardware 2 28th Nov 2004 01:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:58 AM.