Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:18:12+00:00 2026-06-13T05:18:12+00:00

I wrote a vbScript to gather computer information for each user’s computer on login,

  • 0

I wrote a vbScript to gather computer information for each user’s computer on login, and Id like to have the script record the information to an Excel sheet on the server, with each computer having its own row.

I wrote this like 6 years ago but lost the script and havent touched vbScript since.

So what I need to do is,

  1. check all the cells in column B (which would be computer name) that have a value
  2. compare that value to value saved for the computer’s name
  3. if it matches, write the computer info to that row
  4. if there are no matches, then write the info to the first empty row

I have no idea where to start since vbScript is pretty foreign to me.

Edit – I have this loop so far and that echo to test it, but it only goes to 1, while I have like 6 rows with values in column 0. I tried that conditional to check the cell value for a value I know exists and I get a runtime error.

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("test.xlsx")
Do While objExcel.ActiveCell.Offset(iRow,0).Value<>""
   WScript.Echo iRow
   If objExcel.Cells(iRow,0).Value = "three" Then
    WScript.Echo "three"
   End If
   iRow = iRow+1
Loop
WScript.Quit
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:18:14+00:00Added an answer on June 13, 2026 at 5:18 am

    You most likely have an On Error Resume Next somewhere in your script, which makes the code fail silently.

    As far as I can tell from your code this is probably what’s happening:

    • Do While objExcel.ActiveCell.Offset(iRow,0).Value<>""

      The script checks if the cell at the offset (iRow,0) of the active cell is empty and if it isn’t goes into the loop.

    • WScript.Echo iRow

      The script echoes the current value of iRow (probably 0).

    • If objExcel.Cells(iRow,0).Value = "three" Then

      The script tries to access the cell (iRow,0) (not the cell at the offset (iRow,0)), which fails, because Cells() is not zero-based. The first row as well as the first column have the index 1 in the Cells() property. Not to mention that with Cells() you have to use the absolute row and column numbers, not the ones relative to ActiveCell as in Offset().

    To fix the issue I’d remove On Error Resume Next and simply use Cells() instead of ActiveCell.Offset():

    iRow = 1
    Do While objExcel.Cells(iRow, 2).Value <> ""
      WScript.Echo iRow
      If objExcel.Cells(iRow, 2).Value = "three" Then
        WScript.Echo "three"
      End If
      iRow = iRow + 1
    Loop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how to call javascript function from vbscript. i wrote like this <script type=text/vbscript> jsfunction()
I have a VBScript I wrote that needs to be executed from an MSI
I wrote vbscript inside my html file for my site and I can't get
Basic doubt...If QTP generates vbscript code as we record actions, can't we directly write
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
I wrote some script in a site. The script makes a new spreadsheet and
I wrote a PHP script that retrieves values from a MySQL Query. I used
for testing purpose I wrote a VBscript which will fetch values from Sybase by
I'm trying to write a VBScript (.vbs) script that uses the WScript.Shell Run() method,
I have a classic ASP/VBScript application that needs to call methods in a Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.