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

vbs with excel: connections?

Status
Not open for further replies.

guif

Programmer
Sep 6, 2007
27
ES
Hi!
I have a file Excel with a lot of IP's in A1 to A20.
I would like to put a code into the B2 to B20 to know the conexion is OK or no OK.
IT's possible to make some ping's???

For example

A B
1 PC_1 OK
2 PC_2 NO OK
3 PC_3 OK

thank's!
 
You're placing the code, which calls to open the armaris file, from the armaris file, which does not make sense. The code derived is meant to run from another workbook. Will you be calling this code from within the armaris workbook then?

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
oh! the problem is this line:

Set xlSheet = xlBook.Sheets("ARMARIS")
I replace the name to
Set xlSheet = xlBook.Sheets("TOTS")

but... I think that i don't explain correctly.
I would like to put some buttons to learn the rows E3 to E238
If I click to BUTTON_START the code is make a ping infinite and put the result (green or red) in the colum F.

For example:

IP - BUTTON_START_003 - BUTTON_STOP_003
IP - BUTTON_START_004 - BUTTON_STOP_004
...
...
IP - BUTTON_START_238 - BUTTON_STOP_238

 
No, I do not understand. You want a button, which will look only at specific rows? Which rows will the button look at? Are there only certain rows of IP addresses where you want to look/test? How do you determine what should be looked at and what should not?

I apologize if I am not asking the right questions.

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
ok, i explain now and please, see this example:


If i click the start, the script is make a infinite ping and put the colour green. If the conexion is broke, the color put in red.
If I like, i start another conexion or stoped.
 
So you only want to run the ping code on the row where the Start button is located? If so, take a look at the Application.Caller method, set it to a cell range and use the Offset method to get your ranges of the IP address and the cell where you want to place the result.

HTH

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
and it's possible to generate some buttons (start and stop) automatly and use the same funcion for the buttons?
 
Well, I do not think it is efficient to run things that way. We can make one button which will look at the activecell's row. Or perhaps you would like to set another cell as the validation for running the code or not (i.e. a separate column with Yes/No values). A button for every row is not going to be easy to work with. We can write one routine which you can assign the button so it would work in any row, but maintaining the buttons alone seems more than the effort to me. I would suggest going about it another way.

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top