Hello all --
I have an application that I am trying to write that opens up one Excel file, copies a specified range, pastes it to another Excel file, and then closes both of them....
All this in a loop that may iterate a couple hundred times.
The problem is that when I try to close the stinking application, that sodding dialog box about "A large amount of data has been copied to your clipboard... Would you like for this information to be available..." blahblahblah is coming up and preventing me from closing the window. So that on the next iteration, it's trying to open another file (same name, different folder/file), and of course, it can't because a file with the same name is already open.
Anyway, the question is how to tell the dialog box that "IF I WANTED THE INFORMATION ON THE CLIPBOARD STILL, I WOULD NOT CLOSE THE APPLICATION!" or something to that effect.
Here is a bit of code:
This code is in a loop, with the counter, 'i' (which is where the range selection gets its value), but that should make no difference.
Thanks for any input.
Paul Prewett
I have an application that I am trying to write that opens up one Excel file, copies a specified range, pastes it to another Excel file, and then closes both of them....
All this in a loop that may iterate a couple hundred times.
The problem is that when I try to close the stinking application, that sodding dialog box about "A large amount of data has been copied to your clipboard... Would you like for this information to be available..." blahblahblah is coming up and preventing me from closing the window. So that on the next iteration, it's trying to open another file (same name, different folder/file), and of course, it can't because a file with the same name is already open.
Anyway, the question is how to tell the dialog box that "IF I WANTED THE INFORMATION ON THE CLIPBOARD STILL, I WOULD NOT CLOSE THE APPLICATION!" or something to that effect.
Here is a bit of code:
Code:
fileName = File.Name
Set hoursWorld = appworld.Workbooks.Open(path & fileName)
Set hours = hoursWorld.Sheets("Sheet1")
hours.Range("A1").Select
hours.Range("A1", "D" & i).Copy
Set hours = Nothing
hoursWorld.Close
This code is in a loop, with the counter, 'i' (which is where the range selection gets its value), but that should make no difference.
Thanks for any input.
Paul Prewett

