What clipboard formats does SAP read? - excel

We have an automated process that interfaces with the SAP GUI via Excel, copying table data from an Excel spreadsheet into the Windows clipboard and then pasting it out to an SAP "multiselect" modal window. I would like to bypass the use of Excel by directly sending data to the clipboard in the appropriate format, but it isn't clear what formats SAP can read, and my Google searches all just turn up information on how to press the clipboard-related buttons.
I have already written code to access the GUI directly and write the values to the multiselect table, but this way is much slower than using the clipboard. Any information on how to speed this process up would be greatly appreciated, whether it pertains to the appropriate clipboard format or some other way to rapidly transfer the data.

Related

Using applescript within VBA to use safari

I was trying to run a VBA Excel Macro on my mac that sends commands to other apps (explorer).
I figured this doesn't work on the mac, and found that applescript is a bypass solution, but I don't have a clue on how to create one or even call it from excel, so here it goes: I have an excel file with data and the macro opens an website on IE, inputs this data on a certain point, then go back to the excel file and puts an ok beside the data telling that it was done (looks simple).
How do I do this using applescript? In short, I need it to gather some info on the excel file, then input this data on an specific field of a webpage (and click ok) and then go back to excel and there I think I could go back to using VBA again until another loop.

Save logfile within Excel file using VBA

I am trying to develop a manner in VBA to track changes in a document without having to hide the contents in an extra sheet within a workbook.
I understand that if you change the extension of an Excel file to ".zip", you can access the Excel document as components sorted into directories. Is there a way to save and write to a text file within one of these directories so that I can access it every time the document is opened, without having to have the user drag a log file along with the Excel document?
Some facts:
When Excel opens the file, the file is blocked by Excel. There is no possibility to write to that file within VBA
You can store additional data into that file externally or after the Excel workbook has been closed
You would need to have code externally from the workbook to accomplish writing to that file after it has been closed. You may want to use VSTO or an oldschool Excel Addin.
you have to ensure that Excel will not destroy your changes when restructuring or repairing the file.
In the first run, your idea sounds very natural, to not use sheets from a programmer's point of view. You only have full control on Excel files when
you use external libraries (e.g. Spreadsheet Gear) or
you remote control Excel via automation.
you use openxml SDK for Excel
you use VBA
You could insert additonal information and take care that this information is not skipped by Excel.
When you want to do the tracking this way, I would suggest you to use an Excel Addin. There is actually no need for installation when using this kind of Addin. Attach to open workbook and close workbook events and ensure that all changes are written to the Excel Workbook after it has been closed. Certainly you would have to attach to all kind of other events to track all changes to the workbook. You may need to have in mind that there can be more than one workbook opened at a time.
Actually there are alternatives.
write your logging code in VBA or whatever fits
abstract away how your persist the code (e.g. use a data provider)
think about these two alternatives to store logging data:
You can save logging data in cells of excel. When using a "newer" version of excel, you have a limit of 1 million rows. You may want to implement a rolling mechanism that ensures that you never go over the border of 1 million records. (you may be dont want to track a million changes)
You can use the document properties to store you information as xml.
Last but not least, the most obvious: Why not using Excel's functionality of tracking changes? Understand track changes in Excel 2013

excel add in to save internal data?

I am new to writing excel add-in (in C#) and trying to figure out the right way to save some internal data structures so I can restore the state the next time file is opened. I can convert data in xml or base64 strings if it makes things easier. I don't want to maintain a separate file and would like to embed this information inside excel worksheet.
Many thanks for your help.
Use a cell in an invisible sheet (you can name it, for example, "internal data sheet") for storing the information. Excel sheets have a Visible property which can be set programmatically to `xlVeryHidden' which means it can only be made visible again by a program. Here you find some more information:
http://support.microsoft.com/kb/142530/en-us

Copy SYLK formatted text to clipboard from HTA

I'd like to programmatically copy tabular data (both formatting and formulas) to the clipboard from an HTA (HTML Application), to paste into Excel. Excel supports a text format called SYLK for accomplishing this task, but I've run into a snag with over-validation in window.clipboardData.setData(format, data) where format is restricted to either "Text" or "URL", giving the error "Unexpected call to method or property access" if format is set to anything else, and Excel only recognizes SYLK text if format is set to "SYLK", otherwise it pastes as normal text.
I'm wondering if there's another way to set clipboard data from an HTA, such as through a COM control that comes preinstalled with either Windows or Office, that would let me copy SYLK data to the clipboard.
I know I could write a custom COM control and install it on each client, but at that point I might be better off just writing to a file and opening the file instead of using the clipboard.

How to automaticly copy & paste fields from excel into a website form

I have about 50 excel sheets to input on a website everyday, but unfortunately I can only submit 8 of these sheets per hour. Therefore, I'm looking for a tool, or comnbination of tools, that will allow me to automaticly copy & paste fields from Excel sheets, into a designated form on a website, and will allow me to set the time when every action should be completed.
The whole process can be done with just using the keyboard (using tab & several shortcuts), so maybe an automated script for keyboard commands is just what I need..
I really don't have much expierence with automated scripts etc, so if you got a suggestion, or a link, it would be much apreciated!
Thanks
Thomas
You can use AutoIt or PowerPro to do this kind of scripting.
More efficient, however, if the data is in a consistent table layout, is to use the Excel ODBC driver, and write a program to import the data. This will be more reliable than automating keystrokes, but will take more programming know-how.

Resources