Automation via vb.net 2005 *problem*

B

Bill Schanks

I have the below Code.

And on the lines :
..Selection.Copy()
..Selection.PasteSpecial(Paste:=Excel.XlPasteType.xlPasteValues)

I am getting the warning 'Option Strict On disallows late binding'.
Why is that, I am using early binding for my project.

I can just turn off Option Strict, but I'd like to keep it if
possible.

code:
-------
Imports Excel = Microsoft.Office.Interop.Excel

Public Class XLUpdate

Public Sub MySub
Dim XL As Excel.Application
<<Snip>>
With XL
.Workbooks.Open(sUpdateFile)
<<Snip>>
.Selection.Copy()
.Workbooks(sUpdateWB).Activate()
.Range("A3").Select()
.Selection.PasteSpecial(Paste:=Excel.XlPasteType.xlPasteValues)
End With
End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top