Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2008, 06:45 AM
indra_saha indra_saha is offline
Junior Member
 
Join Date: Jun 2008
Posts: 1
indra_saha is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default Need help in Windows wcript/vbscript (.vbs)

Hi

Problem statement :
I have one MS Excel workbook in which one sheet has a column called "Function Name". That column stores the function names. Those functions vb script functions and are defined in one external .vbs file.

Now I am writing a driver script (.vbs file) which will open that excel sheet and read that column to get function name and then call the correcponding function.

I am having trouble to call a vb function whose name itself is a variable that gets filled in at run time after reading the excel sheet.

Here is the code snippet.
-----------------------------------------------------------
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Project\Company\Contro ller\input.xls")

intRow = 2
functionName ="test1"

Do Until objExcel.Cells(intRow,1).Value = ""
if ((objExcel.Cells(intRow, 4).Value = "Y") Or (objExcel.Cells(intRow, 4).Value = "Yes")) then
functionName = objExcel.Cells(intRow, 3).Value
Wscript.Echo (functionName)
Call functionName 'This line throws error
end if
intRow = intRow + 1
Loop

objExcel.Quit
-----------------------------------------------------------
I know how to call a function defined in some other .vbs file, but problem is how to call a function whose name itself is a variable.

Any help would be highly appreaciated.

Thanks
Rabi
Reply With Quote

This ad is part of our Revenue Sharing program
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free 1 GB Space + 30 GB Bandwidth with Windows/Linux Reseller Hosting contactsonia Hosting Forum 1 10-11-2008 11:54 AM
Problem opening up Windows explorer from a web page with vbscript justsaynik ASP & VBScript Forum 0 11-02-2007 12:34 PM
windows trouble. detoam Webmasters Lounge/General Chat 4 02-24-2007 07:53 AM


All times are GMT. The time now is 03:05 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30