Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Excel File accross different server

Status
Not open for further replies.

livezone

MIS
Jan 17, 2003
81
0
0
CA
Hi,
I am using DTS to read data from Excel file. It can easily read data if the file is one the same server but for other server under the same domain it can gurantee that file exists after that it said file did not found.

Here is the script

filename = rs.fields("folder").value + filename

Set objFSO = CreateObject("Scripting.FileSystemObject")


if objFSO.FileExists(filename) Then
msgbox "File Exist"
else
msgbox "File Not Exist"
end if


Dim myXL
Dim myXLWorkSheet

'/// intializes the object variable
Set myXL = CreateObject("Excel.Application")



'/// opens the workbook
msgbox filename
myXL.Workbooks.Open filename ---Error

'/// intializes the activeworksheet variable
Set myXLWorkSheet = myXL.ActiveSheet


MsgBox myXLWorkSheet.Cells(2, 1).Value
myXL.ActiveWorkbook.Close "No", filename
'/// destroys the variables
Set myXLWorkSheet = Nothing
Set myXL = Nothing

I am authorized on this file & It displays that the file exists but when it try to open it said file not found.

Thanks
 
Try mapping a path to the location where the file is and then using that location.

SriSamp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top