문제

I have to migrate document from MS Excel to Open Office with macros. Everything works fine except this function

 If Application.WorksheetFunction.IsNumber(Cells(12, 5)) = False Then
   MsgBox "Nesprávne zadané číslo účtu alebo kód banky!", vbCritical
   ActiveSheet.Protect Password:="****", DrawingObjects:=True, Contents:=True, Scenarios:=True
   Exit Sub
 End If

It's check for values inserted by user. But I get only this error:

BASIC runtime error Variable of object is not set

So I double checked my document, if cell E12 is not empty, but it was filled. Is there in Open Office a different way to check input format? Thanks

도움이 되었습니까?

해결책

The number in Excel Visual basic is different like in oo. try use getCellByName("E12").Value this function returns you Number

다른 팁

If the line If Application.WorksheetFunction.IsNumber(Cells(12, 5)) = False Then fails saying object not set, and you've verified that Cells(12, 5) returns a a value, then the only possibilities that I can think of would be that either Application or Application.WorksheetFunction is Nothing.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top