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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to recreate the same .txt file after just using it for a report

Status
Not open for further replies.
Jan 3, 2001
66
US
When I create a report using delimited text files for the data, I cannot regenerate the text file (actually delete the original text file and then recreate it) because the report still has it open. I have gone to great lengths to close the file after it has been created in my code, but the
report still "grabs" it and will not release it until I get completely out of VB.

I have used FreeFile to get a file handle and then close the file on the way out of the data creation Sub.

In the report Sub I have the following two lines of code:

CRViewerWIP.ViewReport
Set m_report = Nothing

But because the report had the file open, I am prevented from regenerating the data file.
 
cfriedberg: CR will keep a lock on your text file until you exit your code. How about creating the new version as a different name and then delete the original and rename afterwards? David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top