Excel中ClipboardFormats返回的44和50剪贴板格式值含义是什么?
Great question! Those unlisted values in the XlClipboardFormat enumeration are actually internal or Windows system clipboard formats that Excel uses for specific data-handling scenarios. Here's what each one means:
Value 44: This maps to the Windows system clipboard format
CF_LINK(a standard system-defined format with the numeric value 44). Excel adds this format to the clipboard when you copy content that contains linked data—think cells referencing external sources, or embedded linked objects. It lets applications recognize and preserve the connection to the original data source during pasting.Value 50: This is Excel's internal XML Spreadsheet format. While it isn't named in the public
XlClipboardFormatenumeration, it’s used to store structured spreadsheet data in XML format on the clipboard. This format enables more robust data transfers between Excel instances or other XML-aware applications, preserving details like cell formatting, formulas, and spreadsheet structure far better than plain text.
Your test code correctly retrieves all active clipboard formats exposed by Excel:
var app = new ActiveXObject('Excel.Application'); app.Visible = true; var results = new VBArray(app.ClipboardFormats).toArray(); app.Quit(); window.alert(results.join(','));
Keep in mind that Excel often includes multiple clipboard formats simultaneously to support different paste scenarios: plain text (value 0) for simple text pasting, link data (44) for maintaining data connections, and XML structured data (50) for rich spreadsheet transfers.
内容的提问来源于stack exchange,提问作者user20416

