Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code below is giving me a runtime error 13 (type mismatch), but
I cannot figure out why. It is failing on this line: sPDFName = Replace(sWordName, pos, 4, ".pdf") but it appears to use the right syntax. This was tested with an input of WordDocPath = "test.doc" Alan Sub ProcessWord (WordDocPath As String) Dim sPDFName As String, sPDFPath As String Dim pos As Integer, sWordName As String sWordName = WordDocPath pos = InStr(1, sWordName, ".doc") If (pos = 0) Then DisplayErrorMessage (sWordName & " is not a Word document") Exit Sub Else sPDFName = Replace(sWordName, pos, 4, ".pdf") End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
type mismatch | Excel Programming | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
type mismatch--how to fix | Excel Discussion (Misc queries) |