Reflections, getting info from Excel

P

PaulW

Don't know where else to post this, so I thought I'd give it a go here.

I currently have a Reflections Session and an Excel Session. These I run
independantly, but I'm trying to combine them.
I've successfully added into the macro in Excel for it to open the
Reflections Session and automatically transfer the reports.

..WRQReceiveFile "S:\Main Files\Download Reports\", "spoken", rcASCII,
rcOverwrite

Is how each line looks. Unfortunatly, I have one report called FEES**** the
four stars reflect a 4 diget number that increases each working day. So today
it was 4744, tomorrow 4745, and on monday 4746. This also skips bank holidays
as well as weekends.

Currently, I do this by having

ans = InputBox("Fees file for today?")
..WRQReceiveFile "S:\Main Files\Download Reports\", "FEES" & ans, rcASCII,
rcOverwrite

What I would like for this to do is automatically get done. In a reflections
session I have no idea how to have it step up once each working day. I
thought it would be simple because in the linked Excel Document that is
already open, this 4 figure number is in cell D9.

ans = Windows("Do My Work.xls").Sheets("Calculations").Range("D9").Value

With Windows("Do My Work.xls")
With Sheets("Calculations")
ans = Range("D9").Value
End With
End With

Neither of these work, and I end up with the error "Subscript out of range"

Does anyone know how I can get the value of this cell and use it within just
1 line of code in my Reflections macro?
 
J

Juan Pablo González

Try using

ans = Workbooks("Do My Work.xls").Sheets("Calculations").Range("D9").Value
 
P

PaulW

Nope. Same error. I'm guessing that either Reflections VBA can't process the
idea of looking at a "Cell" since it doesn't use cells itself. Or to interact
with another application it requires lots of code or something.
 

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

Top