Hi all,
I have an interesting issue I've run into. I have a macro that is used to import data from a selected file into a specific location. This macro worked fine in Excel 2007, but has an odd glitch where it will just end when run in 2010.
I've tried putting break points on each line that would cause the macro to end, but it never hits those, and never generates an error. (Yes, I double checked that the screen can update and errors can be displayed while testing.)
I think I've narrowed down the issue, but I'm not quite sure how to fix it. This piece of code: (Don't judge)
Specifically, the code seems to just "drop" when the "Set wipwb = Workbooks.Open(Filename:=WIP)" line is run. Now, the file the user will select (and the only one that will work) is an .xls file that has macros in it. (Again, don't judge, I have no control over that.)
Now for the fun part. When I step through the code, it works perfectly. Or at least, until I disabled the macro on the target workbook when opening it. I was left with no macro running, looking at the new workbook, but the next line (wipwb.Worksheets("ETD WIP").Columns("A:U").Copy (wb.Worksheets("ETD WIP DATA").Columns("A:U"))) DID run.
Does anyone have insight into this?
I have an interesting issue I've run into. I have a macro that is used to import data from a selected file into a specific location. This macro worked fine in Excel 2007, but has an odd glitch where it will just end when run in 2010.
I've tried putting break points on each line that would cause the macro to end, but it never hits those, and never generates an error. (Yes, I double checked that the screen can update and errors can be displayed while testing.)
I think I've narrowed down the issue, but I'm not quite sure how to fix it. This piece of code: (Don't judge)
Code:
If WIP <> "False" Then
Set wipwb = Workbooks.Open(Filename:=WIP)
wipwb.Worksheets("ETD WIP").Columns("A:U").Copy (wb.Worksheets("ETD WIP DATA").Columns("A:U"))
wipwb.Close
Else
Exit Sub
End If
Specifically, the code seems to just "drop" when the "Set wipwb = Workbooks.Open(Filename:=WIP)" line is run. Now, the file the user will select (and the only one that will work) is an .xls file that has macros in it. (Again, don't judge, I have no control over that.)
Now for the fun part. When I step through the code, it works perfectly. Or at least, until I disabled the macro on the target workbook when opening it. I was left with no macro running, looking at the new workbook, but the next line (wipwb.Worksheets("ETD WIP").Columns("A:U").Copy (wb.Worksheets("ETD WIP DATA").Columns("A:U"))) DID run.
Does anyone have insight into this?