ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA - Not Excel (https://www.excelbanter.com/excel-discussion-misc-queries/90228-vba-not-excel.html)

PaulW

VBA - Not Excel
 
I've had a search on the internet, and can't find anywhere to ask this, so
thought I'd give it a shot here.

I'm using WRQ Reflection for HP, V12
This uses VBA in a similar manner to Excel, and I've set up a macro to
transfer across certain files. Unfortunatly, some of these files are based on
today's date, ZZ060524 for example will be ZZ060525 tomorrow. I have no idea
how to set up a variable... in Excel it was easy enough to work it all out in
a cell or two, and tell the macro to look at that cell, but since Reflection
has no cells to work stuff out (as far as I know) i'm stumped.

Can anyone help, or at the very least point me somewhere were I might get
help. Cheers

Bob Phillips

VBA - Not Excel
 
Do you mean something like

sFile = "ZZ" & Format(Date,"yymmdd")

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"PaulW" wrote in message
...
I've had a search on the internet, and can't find anywhere to ask this, so
thought I'd give it a shot here.

I'm using WRQ Reflection for HP, V12
This uses VBA in a similar manner to Excel, and I've set up a macro to
transfer across certain files. Unfortunatly, some of these files are based

on
today's date, ZZ060524 for example will be ZZ060525 tomorrow. I have no

idea
how to set up a variable... in Excel it was easy enough to work it all out

in
a cell or two, and tell the macro to look at that cell, but since

Reflection
has no cells to work stuff out (as far as I know) i'm stumped.

Can anyone help, or at the very least point me somewhere were I might get
help. Cheers




PaulW

VBA - Not Excel
 
From that I changed
..WRQReceiveFile "", "ZZ060523", rcASCII, rcAskUser
to
..WRQReceiveFile "", "ZZ" & Format(Date, "yymmdd"), rcASCII, rcAskUser

And this worked perfectly! Cheers. Unfortunatly, it goes wrong on
..WRQReceiveFile "", "YYC" & Format(Date, "ymmdd"), rcASCII, rcAskUser

From which I guess it doesn't like the Y only being 1 digit, and thats only
a guess.

My other problem seems to be that the macro I recorded seems to not have
made a note where these files are to be transfered to, so they're going to
the default folder, rather than where I want them. Will have to check the
settings for that :p

"Bob Phillips" wrote:

Do you mean something like

sFile = "ZZ" & Format(Date,"yymmdd")



Bob Phillips

VBA - Not Excel
 
I would agree with your conclusion, so maybe try

sDate = Format(Date, "ymmdd")
sDate = Right(sDate,Len(sDate-1))
..WRQReceiveFile "", "YYC" & sDate, rcASCII, rcAskUser



--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"PaulW" wrote in message
...
From that I changed
.WRQReceiveFile "", "ZZ060523", rcASCII, rcAskUser
to
.WRQReceiveFile "", "ZZ" & Format(Date, "yymmdd"), rcASCII, rcAskUser

And this worked perfectly! Cheers. Unfortunatly, it goes wrong on
.WRQReceiveFile "", "YYC" & Format(Date, "ymmdd"), rcASCII, rcAskUser

From which I guess it doesn't like the Y only being 1 digit, and thats

only
a guess.

My other problem seems to be that the macro I recorded seems to not have
made a note where these files are to be transfered to, so they're going to
the default folder, rather than where I want them. Will have to check the
settings for that :p

"Bob Phillips" wrote:

Do you mean something like

sFile = "ZZ" & Format(Date,"yymmdd")






All times are GMT +1. The time now is 01:46 AM.

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