I'm calling an excel macro from a word macro, everything was going swimmingly until I adapted the excel macro to encompass
Set myrange = Sheets("Master").Range("K2:K" & lastrow)
I have declared the variable, the excel object library has been referenced I have created the excel object
Dim Xl As Object
Set Xl = CreateObject("Excel.Application")
and I'm using a
With Xl.... ...end with piece of code
Like I say everything was working OK until I introduced the 'Set myrange...' element.
I now get an error 'Type Mismatch'
Any ideas, hope someone can help
thanks in advance
Matt
Set myrange = Sheets("Master").Range("K2:K" & lastrow)
I have declared the variable, the excel object library has been referenced I have created the excel object
Dim Xl As Object
Set Xl = CreateObject("Excel.Application")
and I'm using a
With Xl.... ...end with piece of code
Like I say everything was working OK until I introduced the 'Set myrange...' element.
I now get an error 'Type Mismatch'
Any ideas, hope someone can help
thanks in advance
Matt