I am trying to write this code in VB 2008 (Sorry if in wrong section, cant find 2008) the code is made up of a check box and when you click the check box will enter code into a text box which will then be created into a .bat file which can open you CD drive. (the reason for this is my Cd drive gets stuck whenever i put in a CD and this seems to work) Here is the code.
I keep getting the "Error:Comma, ), or valid expression continuation expected."Code:If Me.CheckBox1.Checked Then items.Add("Set oWMP = CreateObject("WMPlayer.OCX.7"") items.Add("Set colCDROMs = oWMP.cdromCollection") items.Add("do") items.Add("if colCDROMs.Count >= 1 then") items.Add("For i = 0 to colCDROMs.Count - 1") items.Add("colCDROMs.Item(i).Eject") items.Add("Next") items.Add("For i = 0 to colCDROMs.Count - 1") items.Add("colCDROMs.Item(i).Eject") items.Add("Next") items.Add("End If") items.Add("wscript.sleep 5000") items.Add("loop") End if
I tried to fix it and looked around but couldn't get it working. Any help will be much appreciated.![]()




) Here is the code.
Reply With Quote
