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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get excel cell value from external excel spreadsheet

Status
Not open for further replies.

adcmfg

MIS
Jun 4, 2001
1
US
I'm using a terminal emulator that has vbscript capability. I need to fill the fields on the screen with data from an external microsoft excel spreadsheet. I know how to position the cursor on the screen.

I need to know how to get the specific cell contents from an external microsoft excel spreadsheet and "paste" them on the screen.
 
I don't know what kind of environment you are running on, but if you have access to the Excel-component, sometinhg like this might work:

Code:
Dim CellContent, ExcelSheet
Set ExcelSheet = CreateObject("Excel.Sheet")

ExcelSheet.Application.Visible = True

CellContent = ExcelSheet.ActiveSheet.Cells(1,1).Value

'Print CellContent to your fields.

ExcelSheet.Application.Quit
Set ExcelSheet = Nothing
 
I have been rying to use this code and when I try to run it I get an error msg object required. what could be the cause.
 
There are several possibilities for this error to occur.

The CreateObject method belongs to the Server object (Server.CreateObject), so it is quite possible that the terminal emulator don't support use of the Server object.

The object you are trying to create an instance of, in this case Excel, is not available on the server. Is Excel installed?

It might also be that your security options for Microsoft Internet Explorer must be set to enable ActiveX controls and plug-ins. Check your browser's security page. In Microsoft Internet Explorer, open the View menu, choose Options, click the Security tab, and make sure the Enable ActiveX Controls And Plug-Ins check box is checked.

 
Well I am using Astra Mercury interactive tool to devlope a testing tool that that can be used by the tester here.
Now astra is designed in VB script. I have used the Create object method to create record sets and connections they have not given me any problem. But when I used your method it didnt work any way the same method is also given in the Astra Help but that doesnt even work.
But when I used Server.CreateObject to get connected to the Database and and create a record set it asked for the object server.
Seeing the method that you are using I got an Idea to use it as The task I have been Assigned I cant do the way I have been thinking of doing it any way. The conclussion is that I am totally lost now.
Thanx
 

VikramBhalla,

Server.CreateObject("object") is used in an ASP page. If you are using "createObject" in a VBScript text file,
remove "server."

Fengshui_1998
 
As I've mentioned twice already, when you use
Code:
CreateObject("Excel.Sheet")
, you must have the Excel component installed. Do you?

If it is installed, my best bet would be that your CreateObject method simulates the one from the Server object, but that it isn't 100% compatibel.
 
ther must be a simplier way to get data from an excelarc, without that component !!??

/Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top