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!
BigWill5112Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BigWill5112Author Commented:
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>
0
Brad Sims, CCNACyberSecurity AnalystCommented:
You can include an "On Error Resume" statement in your code.  But from the error you posted, it appears there may be some issue with the spreadsheet.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DaveCommented:
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
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

aikimarkCommented:
how many workbooks have been opened at the moment of failure?
0
BigWill5112Author Commented:
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...
0
DaveCommented:
> Maybe there is nothing I can do.

Correct.

If you have all the data (without foratting) then you are relatively fortunate

If the other files have an indentical layout you can just select the worksheets from the second file, copy the cells in the sheets, then paste special - formats, to apply the same formatting layout over your recovered file

Cheers

Dave
0
BigWill5112Author Commented:
I will follow brettdj's advice.
0
aikimarkCommented:
@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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.