How can a web page read from the user’s serial port?

One thing for sure, you will never be able to communicate with the local machine hardware without installing some special binaries (and run it with appropriate privileges) on the local machine. However, that doesn’t mean you necessary need to use an ActiveX component and stay stuck with Internet Explorer. Of course, you could also develop … Read more

Using a WScript.shell activeX to execute a command line

According to the following: http://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.84%29.aspx You should be able to pass the commands directly as part of the strCommand param, you’d probably be better off getting rid of the extra quotes wrapping the entire command and arguments: function callShellApplication(){ var objShell = new ActiveXObject(“WScript.shell”); objShell.run(‘c:\wkhtmltopdf.exe c:\PDFTestPage.html c:\TEST.pdf’); } Also you should be able to handle … Read more

Read and write to an access database using Javascript

First, make sure that ‘/\’ and ‘\’ (in connection string) is just a typo in SO. Second, here is a version of Delete command: function DeleteRecord() { var adoConn = new ActiveXObject(“ADODB.Connection”); var adoCmd = new ActiveXObject(“ADODB.Command”); adoConn.Open(“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=”\\dbName.mdb””); adoCmd.ActiveConnection = adoConn; adoCmd.CommandText = “Delete * From tblName Where FieldName=”Quentin””; adoCmd.Execute(); adoConn.Close(); } And, Edit … Read more

create a text file using javascript

Try this: <SCRIPT LANGUAGE=”JavaScript”> function WriteToFile(passForm) { set fso = CreateObject(“Scripting.FileSystemObject”); set s = fso.CreateTextFile(“C:\test.txt”, True); s.writeline(“HI”); s.writeline(“Bye”); s.writeline(“—————————–“); s.Close(); } </SCRIPT> </head> <body> <p>To sign up for the Excel workshop please fill out the form below: </p> <form onSubmit=”WriteToFile(this)”> Type your first name: <input type=”text” name=”FirstName” size=”20″> <br>Type your last name: <input type=”text” name=”LastName” … Read more

Reducing WithEvent declarations and subs with VBA and ActiveX

Open Notepad and copy code below and paste it in a new txt-file save it als CatchEvents2.cls VERSION 1.0 CLASS BEGIN MultiUse = -1 ‘True END Attribute VB_Name = “CatchEvents2” Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Private Type GUID Data1 As Long Data2 As Integer … Read more