PDA

View Full Version : Visual basic macro recording not working correctly



Advocar
19-09-2003, 12:12 AM
Excel Win xp Prof

Data in A1, B1, C1, 1600 records. Start recording macro. Using keys,
Control + Shift + down arrow will work in Excel 97 but not in XP.
XP End Shift Arrow down works OK Shift End arrow down highlights all records. using alt E alt c alt p works OK. data is as required
Running macro now highlight A! & Move curser to D1, cntrl E cntrl P will paste data and double mouse click on cell line will expand D1 to accept A1 data.
If I run macro it will stop at D1 and not paste data. Hitting Enter will though.
Edit code shows no paste? Instruction. Same result if I use mouse, or use cntl c,x, or v actions.
The data will show in clipboard but no code

If I type “paste”, and place curser on paste push F1 no paste type help screen will be displayed.
Only the copy cut paste functions from the drop down box will be found.

In my work office 97 excel macro misses same section when recording but if I enter code (activesheet,canpaste) macro will run OK

Mouse to expand D1 is recorded OK

Highlting paste, F1 will not provide any help examples etc. Activesheet . canpaste works in office 97 but not in win XP

Any ideas?? Thanks

parry
19-09-2003, 10:39 AM
Hi, I have no problem with Control + Shift + down in either XL 97,2k or XP. Sounds very strange, either a corrupt workbook or XLXP and crapped itself and needs a reinstall. You could try the following: -

1) exporting the module from the 97 version and importing into a new XP workbook with some dummy data. See if code still runs. May be some slight differences in some keyword syntax but in the majority of cases you shouldnt have a problem. This may isolate whether theres a problem with the particular XL workbook as opposed to the app.

2) Do you have any things that start up auto when XLXP starts. eg add-ins, anything in the XLStart folder or a customised Book.xlt template.

3) Reinstall Excel XP - theres something wonky somewhere.

Captive
20-09-2003, 03:51 AM
Part of the way i learnt to write macros was do the steps i wanted and record it then learn how it works to memorise a bit of code and rebuild it as required. Have you tried making a sample recording to see how its done if you dont know how to do something?

parry
20-09-2003, 07:05 AM
> Highlting paste, F1 will not provide any help
> examples etc. Activesheet . canpaste works in office
> 97 but not in win XP

I thought, perhaps wrongly, that Advocar knows some code (ActiveSheet object, CanPaste poperty) but the recording of macros is doing strange things. Advocar, perhaps post the code here with a brief explanation of what you want to achieve if thats the issue.