# Monitoring Excel varabiles

**URL:** <https://www.ruby-forum.com/t/monitoring-excel-varabiles/118097>\
**Category:** Ruby\
**Created:** [October 23, 2007, 8:55pm UTC](https://www.ruby-forum.com/t/monitoring-excel-varabiles/118097 "2007-10-23T20:55:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 8:55pm UTC](https://www.ruby-forum.com/t/monitoring-excel-varabiles/118097/1 "2007-10-23T20:55:49Z")

</div>

I am trying to monitor a cell in excel, however when the value of this  
cell changes it stops the programs and gives an error. I would like to  
know if there is a better way to do this so I can check it on every  
scan.

While images==true  
PLCV=parameters.range(‘b8’)[‘value’]

if PLCV==Trigger  
now=Time.now  
hour=now.hour  
min=now.min  
sec=now.sec  
day=now.day  
month=now.month  
year=now.year  
dest="#{StoredImgDir}\#{month}-#{day}-#{year}  
#{hour};#{min};#{sec}"  
Dir.mkdir(dest)

```
  Dir.chdir(LogDir)
  T=File.new("Log.txt", "a")
  T.puts "There was a jam at #{now}"

```

end

```
if PLCV=Trigger
  Dir.chdir("#{FTPDir}")
  sleep(recordpostbuffer)
  dir2=Dir.new("#{FTPDir}")
  dir2.each do|file|
    copy= true

    if file=="."
      copy=false
    end

    if file==".."
      copy=false
      end

    if copy==true
      FileUtils.copy(file,"#{dest}")
    end

end

```

dir1=Dir.new(FTPDir)  
dir1.each do |file|  
ft=File.atime(FTPDir)  
now=Time.now  
nd=false

```
  if file == "."
    nd=true
  end

  if file ==".."
    nd=true
  end

  if nd==false
    File.new("#{file}", "w+").close
    File.delete("#{file}")
  end
end

```

end

end

---

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/monitoring-excel-varabiles/118097/2 "2007-10-23T22:25:32Z")

</div>

I have found out that it will only crash the program if the cell that  
is being monitored is active. Is there away to tell if the cell is  
active from a coding stand point?
