In my PERSONAL.XLSB file, I started trying to build some VBA. Because I began getting an error, I thought I'd setup a test procedure just to print the name of the active sheet.
The really really weird thing is that in previously built/saved procedures (right now, in testing) I can use the same functionality where I used it before, and just run it to see, and it seems to work) However in trying to build 2 new modules, the code fails with the error "Type mismatch".
Here's the testing code I built just for testing this error:
[CODE vba]Sub TestMeNow()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
[highlight #FCE94F]Set ws = wb.ActiveSheet[/highlight]
Debug.Print ws.Name
End Sub[/CODE]
That code gives me the error:
on the [highlight #FCE94F]highlighted[/highlight] line.
Could this be a form of file/data corruption? If so, what's the best way to recover from it? Or is there really an error that I'm overlooking, and just somehow my brain hasn't woken up well enough this morning?
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
The really really weird thing is that in previously built/saved procedures (right now, in testing) I can use the same functionality where I used it before, and just run it to see, and it seems to work) However in trying to build 2 new modules, the code fails with the error "Type mismatch".
Here's the testing code I built just for testing this error:
[CODE vba]Sub TestMeNow()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
[highlight #FCE94F]Set ws = wb.ActiveSheet[/highlight]
Debug.Print ws.Name
End Sub[/CODE]
That code gives me the error:
Run-time error '13': Type Mismatch
on the [highlight #FCE94F]highlighted[/highlight] line.
Could this be a form of file/data corruption? If so, what's the best way to recover from it? Or is there really an error that I'm overlooking, and just somehow my brain hasn't woken up well enough this morning?
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57