Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel stops working while using Filecopy

Status
Not open for further replies.

gtaborda

Programmer
May 13, 2007
75
0
0
GB
Hi there

I have a VBA routine which copies files from my local server to several servers using FileCopy.

For some reason the routine seems to "lock" Excel, and if you try to click on the Excel page, it goes blank (although it appears the processing still happening on the background)
If you don't click anywhere in Excel, everything seems like it is running smoothly, as I have a number cells which changes Data ("currently coping", "finished", etc) as the process runs.

Because the files being copied are quite large and being copied to other cities, it is a process that takes normally 1-2 minutes each file.

In some cases Excel stops working altogether

I have checked the code and there is no reason for errors and this only happens when using FileCopy across cities/large files

Any ideas what could be causing this problem ?

thanks
 
I have checked the code
Which code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have no idea but...

If your sole purpose here is to copy files, I don't think VBA is your best environment. Think of it: VBA is meant to extend applications, like Excel. Therefore, it seems to me its access to the OS is through the application and is probably not as robust as more "native" languages. I would just script this in DOS-Batch or BASH, depending on your OS. If you'd rather use a more "familiar" syntax, consider Python, or TCL, or PERL.

_________________
Bob Rashkin
 
ok thanks Bong

I was using DOS before, but I just wanted to use Excel as it is "easier" to manipulate than DOS files (and looks more professional when running too)

PHV, I mean the VBA code, that I've checked for possible bugs/errors, but I found none...everything runs smoothly when I run the code step by step...

thanks to both
 
PHV, I mean the VBA code, that I've checked for possible bugs/errors, but I found none..."

Well if that is true, then I can not see how we can help, not knowing if - in fact - that is accurate.

For example, I suspect that the code really needs DoEvents since there is so much processing happening outside the VBA environment. Are you using DoEvents? One would hope so, but how can we know unless you post actual code?

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top