Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help Pass Clipboard content to a variable
#1
1. goal take what's currently in the clipboard and append it with today's date.
2. Then go and save the file I have open in excel as a .txt
3 My original macro works fine 'N.N0N3N0N3N1N0N.chg manual way to do it.
4. I want to take it to the next level now.
5. I'm testing to see if I have it right by activating notepad and pasting there, the problem is it puts note pad into what i paste too.
6.myfilename is what i start out with in the clipboard to add to s1 getclip.

resuslt i get:
myfilename
.030510Notepad

result i want :
myfilename030510

str s1.getclip
str today.time(".%m%d%y%")
str s2.from(s1 today.time(".%m%d%y%"))
s2.setclip
act "Notepad"
'Cv
====================================

==========================================================================================
original macro that works but have to change the date each day. using 'N.N0N3N0N3N1N0N.chg

Save as text tab delimited
act "Excel"
'F12
int w1=wait(5 win("Save As" "bosa_sdm_XL9"))
wait 0.2
'Cv
add todays date into file name
wait 0.2

***********************************
ADDS THE DATE IN THE FILE NAME HERE.
MONTH|DAY|YEAR

'N.N0N3N0N3N1N0N.chg
***********************************
Speak "push Down arrow key"
wait 0 K D
act win("Save As" "bosa_sdm_XL9")
wait 1.2


'TUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDY
wait 1.2

'TTTTDUUUUUUUUUUUUUUDDDY
wait 1.2

'TTTTTTY
wait 1.2
Speak "I'm hear now"
5 win("Microsoft Office Excel" "#32770")
wait 1.2

'Y
wait 1.2

Speak "all done bye bye"
wait 1.2
'Y
#2
So you want to essentially export text versions from an excel file with the date appended to the file name?

I'm sure you could use QM to control Save As functions in excel directly without using your hack method.

Search the forum for Excel, somewhere there is a post for Save As. It may or may not be able to choose file format.

There are many better ways to do this than what you are doing right now.

Jimmy Vig
#3
http://www.quickmacros.com/forum/showthr...p?tid=2550

As far as calling it to SaveAs a certain file format, that's a question for Gintaras. I don't use excel anymore, do not have it installed, and cannot test to help you with a better answer.
#4
Code:
Copy      Help
str s1.getclip
str s2.timeformat(".{MMddyy}.chg")
s2-s1
key (s2)
#5
I'm sure there are, and I'm trying to learn how to do things better, unfortunatley I'm not a programmer and I have to balance learning time with getting the job done. I don't know all the tricks but I'm willing to work on it.

Anyway

When I paste what Gintares suggests into the macro,

It errors Error unknown member.
on timeformat

str s1.getclip
str s2.timeformat(".{MMddyy}.chg")
s2-s1
key (s2)


TheVig Wrote:So you want to essentially export text versions from an excel file with the date appended to the file name?

I'm sure you could use QM to control Save As functions in excel directly without using your hack method.

Search the forum for Excel, somewhere there is a post for Save As. It may or may not be able to choose file format.

There are many better ways to do this than what you are doing right now.

Jimmy Vig
#6
timeformat is new in QM 2.3.1.

This will work.

Macro Macro1282
Code:
Copy      Help
str s1.getclip
str s2.time(".%m%d%y.chg")
s2-s1
key (s2)


Forum Jump:


Users browsing this thread: 1 Guest(s)