Monitoring Excel varabiles

N

nick

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
 
N

nick

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,027
Latest member
MeaganThur

Latest Threads

Top