Jump to content
Macro Express Forums

Issues updating values in GMS tool


praveen7576

Recommended Posts

Hi all,

 

I am running MacroExpress in an Excel file where I have three columns - Department, class, and Item number. The macro copies these values from Excel and looks for the same values in a third-party tool(PRISM) where I have to make some changes for these items(combination of Dept,Class and item number). Now the issue is that if the column 'Dept' has more than 2-digits (for example, 123,345,5679 etc.), then the Macro stops right there and gives an error - saying invalid item combination.

 

I have tried changing the 'if' condition for the dept from <100 to >=1, and it worked for couple of rows, but later it did not accept 3-digit dept number and instead copied the first 2-digits of the dept.

 

I have attached the macro so that you people can have a look and re-attach with the changes needed.

 

Looking forward for a quick and positive reply.

 

thanks.

 

Praveen.

Item_Auto_Defective_Flag_ITM380.mex

Link to comment
Share on other sites

I have attached the macro so that you people can have a look and re-attach with the changes needed.

I've looked at your code. The "Invalid Item Combination" is not a Macro Express error message, so it must be coming from your app. Maybe your app will only accept 2-digits.

 

I would suggest the following:

  • Add 250 ms delays after each clipboard command.
  • Maybe the macro is running faster than Excel can keep up. Slow it down. You have a command at the top that says you are running it 1,000 times faster than normal.
  • The Wait Text Playback commands should be placed after the Text Type commands and not before.

Link to comment
Share on other sites

I've looked at your code. The "Invalid Item Combination" is not a Macro Express error message, so it must be coming from your app. Maybe your app will only accept 2-digits.

 

I would suggest the following:

  • Add 250 ms delays after each clipboard command.
  • Maybe the macro is running faster than Excel can keep up. Slow it down. You have a command at the top that says you are running it 1,000 times faster than normal.
  • The Wait Text Playback commands should be placed after the Text Type commands and not before.

 

Thanks for your response. I have followed your instructions but the macro express isn't responding as required. Please suggest the alternatives. Moreover, it does not copy the 'Class' value from the Excel file and the value for the Item number does not remain same when pasted in PRISM. For example is the Item number is 4567, it takes it as 7645.

 

 

Thanks!

 

Praveen

Link to comment
Share on other sites

Floyd is right, this is not an ME error message, it must be something else.

 

My observation is that you increased the playback speed 1000 times. IMHO this is not a good idea. I suggest that instead of moving around and copying line be line you instead have the user highlight the entire range to process, copy it to a string variable, then write that variable to file, and run the ASCII Text file process. Then write the results to a string variable using tabs to separate columns and CRLF to signify the end of a row. Then when you are all done you can simply paste that entire string variable back into Excel. In my experience this seems like more work but it actually saves a ton of hassle and runs very quick.

 

Another issue could be your formatting of the spreadsheet. If you have digit grouping enable you must understand that if you copy 1,234 you get 1 comma 2 3 4 and not one thousand two hundred and thirty four. You might be pasting a text value (1,234) into a field that expects a numeric value like 1234. If this is the case try stripping out the commas before you do your thing. Just remember, no matter what the data type in Excel ME will only receive the text string representation. This is important to remember when dealing with dates as well. In effect when ME brings it into a variable all of the extra clipboard data is lost.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...