Hi Ray
Maybe there is a problem with the file ?
Try one of the code samples on this pagehttp://
www.rondebruin.nl/copy3.htm
Or try the add-in (link on the page above)
Hi Ron, thanks for your response ...
I just ran a 'test' of sorts and I think I've narrowed the problem
down, but still don't know how to fix it ...
The test was this: I took out all of the source files that have
worked properly before, leaving approx 20 files (incl the file that
the code had continually stopped on). This time, the 'problem' file
worked ok, but the code STILL errored out on the same line
(destrange.Value = sourceRange.Value) on the 16th file.
So, it would seem that I'm defininely over-running some type of
buffer, perhaps the clipboard?
I've tried this code:
Application.CutCopyMode = False
at the end of each loop, to clear the clipboard .... as well as this
code:
Public Declare Function OpenClipboard Lib "user32" ( _
ByVal hwnd AsLong) As Long
Public Declare Function CloseClipboard Lib "user32" () As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Sub ClearClipboard()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Sub
(via Frank Kabel)
No luck on either one ...
any more thoughts?