Dim w, h, wm, wh As Integer

w = CInt(TextBoxW.Text)
h = CInt(TextBoxH.Text)
wm = CInt(TextBoxWm.Text)
hm = CInt(TextBoxHm.Text)


Set objExcel = CreateObject(„Excel.Application”)
Set objWorkbook = objExcel.Workbooks.Open(„E:\test.xls”)

objExcel.Visible = True


Set objWord = CreateObject(„Word.Application”)
objWord.Visible = True

Set objDoc = objWord.Documents.Open(„E:\test.doc”)


pos = InStrRev(strValue, ” „)
posesja_test = Mid(strValue, pos + 1) 

Dim objRegEx As Object
Set objRegEx = CreateObject(„VBScript.RegExp”)

objRegEx.Global = True
objRegEx.IgnoreCase = True
objRegEx.Pattern = „\d”

valid = objRegEx.test(posesja_test)
Debug.Print valid