ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reflections, getting info from Excel (https://www.excelbanter.com/excel-programming/383304-reflections-getting-info-excel.html)

PaulW

Reflections, getting info from Excel
 
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").Valu e

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?

Juan Pablo González

Reflections, getting info from Excel
 
Try using

ans = Workbooks("Do My Work.xls").Sheets("Calculations").Range("D9").Valu e

--
Regards,

Juan Pablo González

"PaulW" wrote in message
...
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").Valu e

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?




PaulW

Reflections, getting info from Excel
 
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.

"Juan Pablo González" wrote:

Try using

ans = Workbooks("Do My Work.xls").Sheets("Calculations").Range("D9").Valu e





All times are GMT +1. The time now is 10:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com