Here is my dilemma. The following code snippet listed below depicts an object variable name "xlobject" that holds an instance of "Excel.Application". At this point in the code, I have one workbook assigned to the "xlobject" (meaning that xlobject.workbooks.count = 1). The first line of code...
hayt,
not sure if this will help, but place this piece of code after the line "myConn.close":
Set myConn = Nothing
i know this sounds stupid of me to state as well, but you may want to ensure that you are actually getting to the section of code where you are closing the connection object...
In the "case needed after" section, do I need to put a set of empty quotation marks before the comma, like this:
'case needed "after
Sheets("Sheet1 (2)").Copy "",Workbooks("Book2").Sheets(1)
Sorry, I'm not in a psoition to test this code out yet, but I wanted to ask the question first. Thanks!
Is there any reason why you are using the string compare method as opposed to just simply testing for equality? Are there any times where you are looking for a substring within a larger string? You may just want to test if they are simply equal to each other. String compare should have worked...
hayta,
not sure if this answers your first question, but once the user clicks a particular value from the drop-down menu, that value is automatically saved. In my code sample below, it is referenced through "frm1.sl1.value". hope this helps, and my apologies if this is not what you were...
Can anyone help me find the VBScript eqivalent of the VBA code listed below? I'm pretty sure VBScript does not support named arguments, so I'm even wondering if this is even possible. Here it is:
Sub Macro2()
Sheets("Sheet1 (2)").Select
Sheets("Sheet1 (2)").Copy...
Try this:
In your WHILE statement, change this:
If inputWO = strColumn1 Then
msgbox = "Thank you."
exit sub
End If
to look like this:
If CStr(Trim(inputWO)) = CStr(Trim(strColumn1)) Then
msgbox = "Thank you."
exit sub
End If
This will convert both values to "string"...
When you say "it fails", do you mean you see the messagebox pop-up that says "Something is wrong.", or that there is some sort of syntax error on the screen?
Insert the code snippet below between the following 2 statements of your original code:
Set rstSurvey = myRecordset
sub window_onload
If Not (rstSurvey.Eof and rstSurvey.Bof) Then
MsgBox "I have data to work with."
Else
MsgBox "Something is wrong."
End If
It should look like...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.