I have a ping script developed by the wonderful support in this forum that I use everyday and it saves me a tonne of work. Thanks again JVierra.
I do have a question in regards to the scripting excel object.
During one section of the code there is a line to write a hard coded value to the cell.
objSht.Cells(1, 25).value = "Ping Status"
Then in the For loop there are 2 lines of code that write a value to the cell dependant on the outcome.
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then objSht.Cells(intRow,25) = "OFFLINE" Else objSht.Cells(intRow,25)= "online" End If
My question is in regards to the "value" property. It is used in the line that writes "ping status" but is not included in the lines of code found in the For loop. I've tried the script taking out the .value property and it works the same. What is the advantage or requirement of using ".value"?
Scripting Excel question
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Scripting Excel question
JVierra,
I was going guess that it was the default property of .Cells, but couldn't find it in MSDN for .Cells. Anyway, isn't that what Visual Studio boastssuggests "strongly-typed" code for, to eliminate "doubt"? To add to your answer in that case, would it be safe to say that not specifying the property (.value) would be like using a shortcut in the code? It works, but it's not specific and could cause issues later.
I was going guess that it was the default property of .Cells, but couldn't find it in MSDN for .Cells. Anyway, isn't that what Visual Studio boastssuggests "strongly-typed" code for, to eliminate "doubt"? To add to your answer in that case, would it be safe to say that not specifying the property (.value) would be like using a shortcut in the code? It works, but it's not specific and could cause issues later.