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...
haytatreides,
Do you know how to test to see if you are actually pulling back data from your SQL datasource? You might not be connecting correctly to the data. One way you can accomplish this is by defining an ODBC System DSN and connect to your data that way. You stated in your previous...
The code snippet below works under NT, but is failing when I run this in Windows XP:
'copy current invoice to the master invoice
'workbook, place at beginning of workbook
xlsheet.Copy(xlMasterWorkbook.Sheets(1))
if err.number <> 0 then
MsgBox "Error " & Err.number & ": " & Err.description...
Try this:
<HTML>
<HEAD>
<TITLE>Test PopUp</TITLE>
<script language="VBScript">
Sub DisplayPopup
Dim strTmp
strTmp = "<input type='text' id='varTxt1' name='varTxt1'>"
divPopUp.innerHTML = strTmp
End Sub
Sub DisplayVal
MsgBox "Typed value: " & varTxt1.value
End Sub
</script>
</HEAD>...
I am currently working on an .asp application that manipulates
Excel from a web page using VBScript. The application
works fine on an NT platform, but it needs to be modified to
work under Windows XP. I am having problems with the section
of code described below. Here is what is happening...
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.