?
Solved

Simple filecopy in VB6 fails

Posted on 2014-10-18
2
Medium Priority
?
221 Views
Last Modified: 2014-10-19
This code works fine if I watch it in the debugger one line at a time.

    tempi = folderPath + "Seagate Crystal Reports - recptasc.pdf"
    tempj = folderPath + querFind
    FileCopy tempi, tempj
    kill tempi

But if I let the code run from statements above those lines to the line after those lines, it fails.

Pulling my hair out and I don't have any to spare.  Any help appreciated.
0
Comment
Question by:Skip_Laughlin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Author Comment

by:Skip_Laughlin
ID: 40389531
The file in question is created by Crystal reports running a pdf writer.  All that works fine.  But I need to rename the ouput file to continue with processing in my app.  It acts like there is some sort of lock on the file which prevents the copy and delete.  If there is a lock, I don't know what it is or how to release it.  Help please.
0
 

Accepted Solution

by:
Skip_Laughlin earned 0 total points
ID: 40389968
Problem resolved.  It was a timing issue.  The step before the code above created the file in question with Crystal Reports running a PDF printer.  I put a 5 second delay in after the Action statement and before the copy statement, which gives it time to finish creating the PDF file.  World is much brighter this morning.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Simple Linear Regression
Six Sigma Control Plans

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question