Paste as link phoenix viewer6/11/2023 If I use the 'Set Cell Value' option above then the entire report is entered into the single Cell A1. txt file and use Excel to open the file - then whilst I get a separate line for every line of the report, all of the data is in column A When using Right Click & Paste, or CTR+V to paste the clipboard into Excel, all of the formatting from the original report is retained and as such financial values are in the correct required columns. Sorry - I should have also mentioned in my original post, I have already tried exactly what you show here using the 'Set Cell Value' action in the Excel VBO - and whilst it does paste the clipboard data item into cell A1 - there are a few reasons why this doesn't work for me. Many thanks for taking the time to reply, Subject: Error trying to paste data from clipboard into Excel using Excel VBO If anyone has any ideas as to how I can paste my 3rd party data clipboard directly into Excel this would be greatly appreciated. txt file - the resulting txt file is not suitable to open in Excel. I know that the data is correctly in the clipboard as I can use a 'Utility - Environmnet, Get Clipboard' and successfully write it to a data item, however, this then removes all of the formatting so even if I write this data item to a. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))' - the same as simply using range.paste However, this also generated the error 'Exception : Failed to paste from clipboard: Invalid index. Range.PasteSpecial(Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True) So using this I amended the VBO Paste - line 9 ![]() 'ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False' I think the problem is due to my data not originating in the same Excel instance that I am trying to paste it into, so I used the macro recorder to record the VBA generated by pasting the data into Excel, which returned:. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))' However this generates the Error message 'Exception : Failed to paste from clipboard: Invalid index. Range.PasteSpecial(Paste:=Paste_Option, Operation:=-4142, SkipBlanks:=False, Transpose:=False) I have tried modifying the Excel VBO from a PasteSpecial into just a Paste, by amending line 9 of the VBO code This generates the error message ' Exception : Failed to paste from clipboard: PasteSpecial method of Range class failed' MS Excel VBO - Select (to select Cell reference A1) ![]() I can get the data into the clipboard of my automation by using Global Send keys and sending the CTR+A, CTR+C to the application - the problem I have is in then trying to paste this data into Excel. The manual process is to currently run the report to screen, highlight the application, then CTR+A, CTR+C to copy the report to clipboard, and then to CTR-V into Excel - which works correctly. The Automation I am working on is to automate the production of various system reports at specific points in time, the output from one of the reports is required in Excel, however the application does not have a native 'Export' function for this particular report. I am having problems trying to paste data from a 3rd party application into Excel using the Excel VBO.
0 Comments
Leave a Reply. |