Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remote xls

19 views
Skip to first unread message

vins

unread,
Feb 4, 2013, 5:12:02 PM2/4/13
to
Hi,
I am trying to access a xls file which is in the remote machine , same network.
(I am able to remote login to the machine)

I create a vbs file with below code.
When i clicked on "msgbox oSheet.Cells(1, 1).Value" --> throws an error
'Unknown runtime error'.

strFileName = "C:\Automation\Sanity Testing Tracker.xls"
Set objExcel = CreateObject("Excel.Application","10.40.84.156")
Set objWorkbook = objExcel.Workbooks.Open(strFileName)
Set oSheet = objWorkbook.Sheets(1)
msgbox oSheet.Cells(1, 1).Value

Any of you have any clue?

steve...@yahoo.com

unread,
Feb 5, 2013, 1:33:52 PM2/5/13
to
Are you running the script from the local client (as oppossed on remote work station?)
If the script is running on a different machine than the Excel file location then you likely need to share the remote directory which contains the Excel workbook, with either just the client machine you are working from, or for everyone.

This line:
strFileName = "C:\Automation\Sanity Testing Tracker.xls"

Would become:
strFileName = "\\RemoteComputerName\ShareDirName\...\Sanity Testing Tracker.xls"

Did you successfully create the Excel object/workbook/worksheet?


0 new messages