VBA - Not Excel

G

Guest

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
 
B

Bob Phillips

Do you mean something like

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

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
G

Guest

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
 
B

Bob Phillips

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)
 

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