天道酬勤,学无止境

activexobject

How to reference ActiveX ComboBox in Excel 2016 VBA

问题 我在这里和其他地方尝试了各种解决方案,例如: dim wb as workbook, ws as worksheet Dim cb As Object Set cb = ws.OLEObjects("ComboBoxViews") 或者 ComboBoxViews 或者 ws.comboboxviews 但是都返回错误 1004,没有找到具有指定名称的项目。 但它确实存在,检查名称非常清楚的属性是'comboboxviews'。 有任何想法吗? 编辑: 为了让其他人在未来寻求帮助并使用 Romcel 非常有用的代码作为基础,似乎为了向 ActiveX ComboBox(这是我的最终目标)添加项目,您需要将其作为对象引用: Sub caller3() Dim ws As Worksheet Dim oleob As OLEObject Set ws = ThisWorkbook.Sheets("Sheet1") For Each oleob In ws.OLEObjects If TypeName(oleob.Object) = "ComboBox" Then oleOb.Object.AddItem "TEST" <<< CORRECT oleOb.AddItem "TEST" <<< INCORRECT End If Next End Sub 回答1

2022-05-17 02:31:07    分类:技术分享    excel   activexobject   vba

Ajax call: What is the difference between new ActiveXObject("Msxml2.XMLHTTP") and new ActiveXObject("Microsoft.XMLHTTP")?

问题 我希望两个对象调用都引用 ActiveXObject。 但是为什么我们要传递两个不同的参数来在 IE 中工作。 1. Msxml2.XMLHTTP 和 2. Microsoft.XMLHTTP 他们都一样吗? 或者它们是否依赖于浏览器(IE7 和 IE8)? 我两个都用过。 我没有得到任何例外。 两者对我来说都一样。 我正在使用 IE 8。 回答1 两者实际上都已经过时了。 微软古老的 MSXML ActiveX 对象有多种版本(我相信最后一个版本是 5.0 版,并附带了某些版本的 Office。)这些版本在行为上有细微差别,并且错误修复通常不会在 AJAX 场景中发挥作用. 从 IE7 开始,Microsoft 支持其他现代浏览器采用的标准化“XmlHttpRequest”对象。 请参阅 http://msdn.microsoft.com/en-us/library/ms537505(VS.85).aspx。 您绝对应该使用它,因为 IE7 现在是事实上的最低公分母。 大多数主要组织已宣布 IE6 已死,因此没有理由支持旧的 Microsoft 特定 ActiveX ProgID。 当然,现在几乎没有理由推出自己的 AJAX 调用,因为像 jQuery 和 ASP.NET Ajax 之类的库会为你做这件事,抽象出这些晦涩的浏览器怪癖。 我强烈建议学习其中一个库。 乔丹·里格

2022-04-27 21:11:12    分类:技术分享    ajax   activexobject

How to reference ActiveX ComboBox in Excel 2016 VBA

I've tried various solutions on here and elsewhere such as: dim wb as workbook, ws as worksheet Dim cb As Object Set cb = ws.OLEObjects("ComboBoxViews") or ComboBoxViews or ws.comboboxviews But all return Error 1004, the item with specified name wasn't found. But it DOES exist, checking properties the name is very clearly 'comboboxviews'. Any ideas? EDIT: To make it clear for anyone else seeking help in the future and using Romcel's very helpful code as a base, it seems that in order to add items to an ActiveX ComboBox (which is my final goal), you need to reference it as an object: Sub

2022-04-26 18:20:50    分类:问答    excel   activexobject   vba

Ajax call: What is the difference between new ActiveXObject("Msxml2.XMLHTTP") and new ActiveXObject("Microsoft.XMLHTTP")?

I hope both the object invocations are referring to the ActiveXObject. But why are we passing two different parameters to work in IE. 1. Msxml2.XMLHTTP and 2. Microsoft.XMLHTTP Are they both same ? Or Are they browser dependent(IE7 and IE8) ? I used both. I did not get any exception. Both are looking same for me. I am using IE 8.

2022-04-04 14:08:39    分类:问答    ajax   activexobject

Java Desktop.browse occasionally returning "requested lookup key not found in any active activation context"

I am really struggling with this issue as it seems to occur randomly for me. When I call, Desktop.browse("some url"); Internet Explorer will not display. The exception message is as follows, The requested lookup key was not found in any active activation context. When it occurs it occurs consistently until I restart the machine, but it eventually occurs again. The workstations that seem to have this problem are running Windows XP with Internet Explorer 8 set as the default browser. EDIT: I forgot to mention that if I open up Internet Explorer directly and navigate to the URL in question then

2022-03-25 08:34:15    分类:问答    java   internet-explorer   activexobject   jacob

Suppress ADO Security Warning in JavaScript/HTM Page

I have a fully functioning site stored on a network drive along with an Access Database which acts as the site's database. Due to lack of server side code, I am forced to use JavaScript to create an ADO ActiveX object to connect to the database. This works. The problem I am having is that whenever the user opens the site an ADO Security warning appears asking if they trust the site. If they press 'Cancel' the error thrown is: Safety settings on this computer prohibit accessing a data source on another domain however the database is stored in the same network directory as the site... If they

2022-03-19 19:06:57    分类:问答    javascript   ms-access   activex   ado   activexobject

in JavaScript, when finished with an object created via new ActiveXObject, do I need to set it to null?

In a Javascript program that runs within WSH and creates objects, let's say Scripting.FileSystemObject or any arbitrary COM object, do I need to set the variable to null when I'm finished with it? Eg, am I recommended to do this: var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileStream = fso.openTextFile(filename); fso = null; // recommended? necessary? ... use fileStream here ... fileStream.Close(); fileStream = null; // recommended? necessary? Is the effect different than just letting the vars go out of scope?

2022-03-19 07:53:11    分类:问答    javascript   wsh   activexobject   jscript