Copy paste macro works in 2003, not in 2010 - Works in accordance with AS400 macro
First let me describe what we use this code to do. We have a bunch of different products we need to upload to AS400 with many different prices, or markups, or what have you. Excel and AS400 macros work in accordance to accomplish this. Excel will copy
one cell, and paste to a location repeatedly until it pastes a different value, then it will copy the next cell and paste again repeatedly until it pastes a new value. It gets these new values from AS400. What the macro in AS400 does is pastes the value
it needs from Excel, moves to another screen and/or field, copies a value to tell Excel that it would like to move on to the next value, then it pastes the new value that Excel will have copied. The Excel code is pasted below.
Sub TUACA_ITEM_AND_VALUE()
'This macro works in conjunction with a Tuaca macro using the windows clipboard.
'Excel copies the FSA item number to the clipboard, and then repeatedly pastes
'the clipboard contents until the value does not equal the FSA item number.
'It then copies the 2nd cell to the clipboard, and then repeatedly pastes
'the clipboard contents until the values do not equal.
'Tuaca pastes the FSA item number, runs its process, copies a new value to the
'clipboard, then pauses before resuming.
'It then pastes the 2nd cell value, runs its process, copies a new value
'to the clipboard, then pauses before resuming.
'this statement avoids premature termination
On Error Resume Next
'variable set
Dim row_number As Double
Dim existing_data, pasted_data As String
'starts at row 1 in the active sheet, and advances 1 row at a time until a blank
'cell in the first column is found
Cycle_Rows:
row_number = row_number + 1
If Cells(row_number, 1) = "" Then GoTo send_FIN
'copy the 1st cell to the clipboard
copy_1:
Cells(row_number, 1).Copy
'pastes the value from the clipboard into the third column
paste_clipboard_contents_1:
Cells(row_number, 3).Select
Selection.PasteSpecial Paste:=xlPasteValues
'routes the process based on the first and third column equality
test_data_1:
existing_data = CStr(Cells(row_number, 1).Value)
pasted_data = CStr(Cells(row_number, 3).Value)
If existing_data = pasted_data _
Then GoTo paste_clipboard_contents_1 Else GoTo copy_2
'copy the 2nd cell to the clipboard
copy_2:
Cells(row_number, 2).Copy
'pastes the value from the clipboard into the third column
paste_clipboard_contents_2:
Cells(row_number, 3).Select
Selection.PasteSpecial Paste:=xlPasteValues
'routes the process based on the second and third column equality
test_data_2:
existing_data = CStr(Cells(row_number, 2).Value)
pasted_data = CStr(Cells(row_number, 3).Value)
If existing_data = pasted_data Then GoTo paste_clipboard_contents_2 Else GoTo Cycle_Rows
'copies "Fin" to the clipboard so that Tuaca's macro knows when to terminate
send_FIN:
Cells(row_number, 3) = "Fin"
Cells(row_number, 3).Copy
End Sub
When this bit of script is run in 2003, it works like a charm (unless there is another office 2010 product open, such as Outlook. Yes, Outlook must be closed in order to run this macro). The issue I believe is with the clipboard. As soon as the macro
is run in 2010, or when it is run with Outlook open, AS400 has a hard time accessing the clipboard. The computer will slow dramatically, and AS400 will end up just not being able to access the clipboard. I have tried a few different things: making the cell
data a string and putting it in the clip board instead of copy pasting, adding in a sleep function to try and make it so Excel is taking less of the clipboard's attention, etc. Nothing has worked so far.
Any thoughts on how this problem might be fixed? As of right now, I think we might be stuck until we upgrade from AS400.
Anwsers to the Problem Copy paste macro works in 2003, not in 2010 - Works in accordance with AS400 macro
Download SmartPCFixer for Free Now
Windows Error Reporting - To Fix Copy paste macro works in 2003, not in 2010 - Works in accordance with AS400 macro
- Go to Start button.
- Open Control Panel.
- Go to Windows Error Reporting.
- Click on System and Maintenance, then click Problem Reports and Solutions.
- Next, click Change Settings located on the left side panel of the Problem Reports and Solutions window.
- Select an option to configure how you want Windows to look for a solution to your problems. You may allow Windows to do it automatically or ask you every time to check if problem occurs.
- Next, click the Advanced settings link.
- Select Off to turn off Error Reporting.
Recommended Method to Repair the Problem: Copy paste macro works in 2003, not in 2010 - Works in accordance with AS400 macro:
How to Fix Copy paste macro works in 2003, not in 2010 - Works in accordance with AS400 macro with SmartPCFixer?
1. Download Error Fixer. Install it on your computer.
2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.
3. The Fixing part is done, the speed of your computer will be much higher than before and the errors have been removed.
Related: How Can You Update & Download NVidia 6100, 6800 GS/XT Display Driver v.260.89 WHQL,Where to Download NVidia GeForce 8800 GT WHQL-certified driver v.196.21,How to Update & Download NVidia GeForce Go 7400 Display Driver v.260.19.12,[Solved] Download NVidia GeForce GTX 460M Driver v.331.82,Download NVidia Quadro Plex Model IV VGA Driver v.304.43 Certified,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver
Read More: Solution to Error: convert a cells text to basic html code,Troubleshooter of Error: Connection of Windows 7 64bit laptop via wireless network to a Canon Image Class D860 printer connected to Windows XP 32bit desktop.,Troubleshooting:corrupted outlook express,Tech Support: Ctrl C & Ctrl V not working on Windows 7 using Office2010,Solution to Error: Count multiple instances,Closing Internet Explorer causes error,Compare 2 Tables and Calculate the PROFIT Faster,Computer goes to Windows Boot Manager after Start,Connect to one of my network computer remotely when don't allow exception box Marked,computer locking up randomly
0 comments:
Post a Comment