skvabbili
Apr 24th, 2006, 02:59 PM
I am getting "The remote server machine does not exist or is unavailable"
I am trying to access the VLookup function in my VB code (running as a COM+ component) to loopkup a range in excel file and update some data to database. The current sheet is Sheet1 and the range SRng is on Sheet2
Set xlMyApp = CreateObject("Excel.Application")
xlMyApp.Workbooks.Open ("BudFile.xls")
xlMyApp.Workbooks(1).Application.DisplayAlerts = False
.....
.....
Set rngSp = xlMyApp.Workbooks(1).Worksheets("Sheet2").Range("SRng")
lsSpID = Application.VLookup(Trim(xlCell.Value), rngSp, 2, False)
If IsError(lsSuppID) Or Trim(CStr(lsSpID)) = "" Then
'.....do someting
Else
'....do something else
End If
Any solutions please.......
I am trying to access the VLookup function in my VB code (running as a COM+ component) to loopkup a range in excel file and update some data to database. The current sheet is Sheet1 and the range SRng is on Sheet2
Set xlMyApp = CreateObject("Excel.Application")
xlMyApp.Workbooks.Open ("BudFile.xls")
xlMyApp.Workbooks(1).Application.DisplayAlerts = False
.....
.....
Set rngSp = xlMyApp.Workbooks(1).Worksheets("Sheet2").Range("SRng")
lsSpID = Application.VLookup(Trim(xlCell.Value), rngSp, 2, False)
If IsError(lsSuppID) Or Trim(CStr(lsSpID)) = "" Then
'.....do someting
Else
'....do something else
End If
Any solutions please.......