Link to home
Start Free TrialLog in
Avatar of BigWill5112
BigWill5112

asked on

Please help. Has to be simple issue with Macro

2009_04_23.xls
2009_04_24.xls

This won't work:

Set wbkPos = Workbooks.Open("I:\Position Tool\" & UCase(Format(dtFlow, "yyyy") & "\" & Format(dtFlow, "yyyy_mm_") & _
    Left(Format(dtFlow, "MMM"), 4)) & "\" & Format(dtFlow, "yyyy_mm_dd") & ".xls")

I set the macro up to open 6 months worth of workbooks and grab data.  Worked perferctly, ran through monthly folders and all and just randomly stops on 4/24.  Help!
Avatar of BigWill5112
BigWill5112

ASKER

Anything I can do?


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <logFileName>error034400_01.xml</logFileName>
  <summary>Errors were detected in file 'I:\Position Tool\2009\2009_04_APR\2009_04_24.xls'</summary>
- <additionalInfo>
  <info>Excel recovered your formulas and cell values, but some data may have been lost.</info>
  <info>Excel found errors that may cause some recovered data to be put in the wrong cells. Please check your recovered data carefully.</info>
  </additionalInfo>
  </recoveryLog>
ASKER CERTIFIED SOLUTION
Avatar of Brad Sims
Brad Sims
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dave
Can you pls post your full code and at least two files, including the "bad" file for us to test. It does sound like corruption in the file being opened
You should never use "On Error Resume Next" unless you are trapping a deliberate outcome to be conditionally dealt with.
Cheers
Dave
how many workbooks have been opened at the moment of failure?
John15-16,
You are correct sir.  After spending about an hour staring at 2009_04_24.xls I decided to actually open it, lol.  I get the "Excel found unreadable content in '2009_04_24.xls'.  Do you want to recover the contents of this workbook?  If you trust the source of this workbook, click yes."  When I click yes I get a "Repairs to '2009_04_24.xls'" dialogue box that says Excel was able to open the file by repairing or removing the unreadable content.
- Excel recovered your formulas and cell values, but some data my have been lost.
- Excel found error that may cause some recovred data to be put in the wrong cells.  Please check you recovered data carefully.

Click the following to view your log file listing repairs:  Link

The file has lost all formatting.  Is there anyway to get it back?  What should I do.  I have opened it by repairing it ,but have yet to save the repaired copy.  Maybe there is nothing I can do...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will follow brettdj's advice.
@BigWill5112

Your http:#31345634 comment is not a solution to this problem.  The correct allocation of points should be:
250 to John15-16 for comment http:#30977039
250 to bretdj for comment http:#31345634

The first comment pointed to a broken workbook.  The second comment allowed you to transfer the formatting.