xlDown in vbscript 
Author Message
 xlDown in vbscript

I am trying to control an Excel file from within a .asp file using VBScript, the
problem i am encountering however is that I can't get it to execute the End
(xlDown) command correctly.  I was just wondering if i have left anything obvious
out, see below for example.

<script language="vbscript">
Dim objXL
Sub Submit
Set objXL = CreateObject("Excel.Application")
objXL.Visible = TRUE
objXL.Workbooks.Add
objXL.Range("A1").End(xlDown).Select      <-- The program returns error here.

Thanks in advance,
Ryan



Fri, 05 Dec 2003 10:38:50 GMT  
 xlDown in vbscript
You probably need to use the enumeration number for xlDown as opposed to the
phrase "xlDown" in much the same way as you do when using the ADO object.
When using a ADO from ASP, if you want to use the enumerated types you need
to include a file (ADOVBS.INC) that translates the enumerated constants to
the relevant number.  You can do the same with the Excel enumerations that
you wish to use in your code.

Create a file and call it xlvbs.inc and save it in the same directory as the
ASP page you are using.  Add the following lines of code:
<%
Const xlToLeft = 1
Const xlToRight = 2
Const xlUp = 3
Const xlDown = 4
%>

Within your ASP page, include the xlvbs.inc file using <!-- #include
file="xlvbs.inc" -->

This should work.

Glenn


I am trying to control an Excel file from within a .asp file using vbscript,
the
problem i am encountering however is that I can't get it to execute the End
(xlDown) command correctly.  I was just wondering if i have left anything
obvious
out, see below for example.

<script language="vbscript">
Dim objXL
Sub Submit
Set objXL = CreateObject("Excel.Application")
objXL.Visible = TRUE
objXL.Workbooks.Add
objXL.Range("A1").End(xlDown).Select      <-- The program returns error
here.

Thanks in advance,
Ryan



Sat, 06 Dec 2003 16:45:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using xlDown from Word

2. VBScript in a VBScript...Help

3. VBScript in a VBScript help

4. VBScript in a VBScript?......Help

5. How to create collection in VBScript, precisely in a vbscript class

6. repeating in VBScript for VBScript GODS!

7. VBScript 1.0 VS VBScript 2.0

8. Returning a value from one vbscript to another vbscript

9. VBScript in a VBScript help

10. execute vbscript within vbscript

11. VBScript 5.1.5907 vs. VBScript 5.5.5207

12. Calling a second VBScript from within another VBscript

 

 
Powered by phpBB® Forum Software