Solved

Simple filecopy in VB6 fails

Posted on 2014-10-18
2
207 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Six Sigma Control Plans
Introduction to Processes

705 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