Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-02-2017, 02:06 PM
lukuangyu lukuangyu is offline
Registered User
 
Join Date: Aug 2017
Posts: 1
objSheet_2.Cells(i, j) is not working

Here is my code for reading the values from a spreadsheet, the values are correctly trimmed however getting "unknown error" when running the script.

Dim START_R
START_R = Trim(objSheet_2.Cells(1, 15).Value)

Dim END_R
END_R = Trim(objSheet_2.Cells(2, 15).Value)

Dim CFG_C
CFG_C = Trim(objSheet_2.Cells(1, 17).Value)

MsgBox "START_R: " & START_R
MsgBox "END_R: " & END_R
MsgBox "CFG_C: " & CFG_C

''' MsgBoxs return with correct value.

Dim j
j = CFG_C
Dim COMMAND_FILE

MsgBox "J = " & j

''' j also return with correct value

For i = START_R To END_R
COMMAND_FILE = objSheet_2.Cells(i, j).Value

'''Getting "Unknown runtime error" for above line
'''If I hard code j to a number then above line is working so seems "j = CFG_C" was not treating it as an number.
Reply With Quote
  #2  
Old 08-02-2017, 03:17 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 472
Hi lukuangyu,

Which Vandyke product and version are you using? What Operating System are you running on?

To get a better idea of what is happening would it be possible for you to provide the full script and a sheet of sample data?

Please redact any sensitive data from both. If you prefer to email it directly to me please send an email to Support@VanDyke.com with "Attn: Eric Forum post 12766" in the subject line.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 04:06 AM.