Hi There,
I am working on a small find and replace macro that references an excel spreadsheet for the "replace" portion. My problem is that when the "replace" portion in excel gets to be a bit long it errors out with "String Parameter too long". Which I do not understand b/c none of them are over 255 characters.... Here is what I have
Set xls = CreateObject("Excel.Application"
xls.Workbooks.Open "\\koop\shared\TESTTBL.xls"
xls.Visible = True
n = 1
xls.Range("e2".Select
Do While n < 131
With Selection.Find
.Text = xls.ActiveCell.Value
.Replacement.Text = xls.ActiveCell.Offset(0, 1)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
n = n + 1
xls.ActiveCell.Offset(1, 0).Select
Loop
Any ideas why this would be erroring out on me?? Any help is greatly appreciated!
Nina
I am working on a small find and replace macro that references an excel spreadsheet for the "replace" portion. My problem is that when the "replace" portion in excel gets to be a bit long it errors out with "String Parameter too long". Which I do not understand b/c none of them are over 255 characters.... Here is what I have
Set xls = CreateObject("Excel.Application"
xls.Workbooks.Open "\\koop\shared\TESTTBL.xls"
xls.Visible = True
n = 1
xls.Range("e2".Select
Do While n < 131
With Selection.Find
.Text = xls.ActiveCell.Value
.Replacement.Text = xls.ActiveCell.Offset(0, 1)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
n = n + 1
xls.ActiveCell.Offset(1, 0).Select
Loop
Any ideas why this would be erroring out on me?? Any help is greatly appreciated!
Nina