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
Solved

Simple filecopy in VB6 fails

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

809 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