Search:

Type: Posts; User: His Nibbs

Page 1 of 6 1 2 3 4

Search: Search took 0.03 seconds.

  1. Thread: VB Code help

    by His Nibbs
    Replies
    3
    Views
    1,089

    Re: VB Code help

    Use FileSystemObject methods to open and create files. For the recent file list, the program could maintain a file which contains file names, operations, and maybe dates and times, which is...
  2. Replies
    2
    Views
    1,441

    Re: Exit VBScript after Time X

    Try putting:

    WScript.Timeout = 60*10
    in the script
  3. Re: How to handle: 'A query with this name already exists...'

    Run this to delete all queries on the active sheet:

    While ActiveSheet.QueryTables.Count
    ActiveSheet.QueryTables(1).Delete
    Wend
  4. Replies
    1
    Views
    826

    Re: Please help with VB script

    VBScript doesn't like the + in btn+_OnClick. Try:

    <input id="Plus" type="button" Value="+" />

    <script language="vbscript">
    Sub Plus_OnClick()
    txtNum.value= Cint(textTop.value)...
  5. Replies
    7
    Views
    5,923

    Re: Copy and paste in excel

    The Cells object needs an explicit sheet reference (Excel VBA defaults to ActiveSheet, but not VBScript).

    With Xlsheet
    .Range(.Cells(3, j), .Cells(24, j + 1)).Copy .Range(.Cells(3, j+2),...
  6. Re: VB Excel Code to stop when the File is not found

    Have a look at the VBA Dir function.
  7. Replies
    7
    Views
    5,923

    Re: Copy and paste in excel

    What is the exact error?

    Do a bit of debugging on the Copy line, e.g. output the j variable; is it zero?

    I'm not sure if you can do separate Copy and Paste operation (which uses the Clipboard...
  8. Re: Vbscript: How to access source html part of a webpage

    WScript.Echo IE.Document.GetElementsByTagName("HEAD")(0).innerHTML

    For the IE window, loop through Shell.Windows looking for some aspect of your web page, e.g. the URL, partial URL, title etc.
  9. Replies
    3
    Views
    1,305

    Re: Cancel button and OK button act the same

    "I know VERY little about vbs "

    So why don't you search for VBScript inputbox?
  10. Re: Running Excel Macro From VBS (with 2 versions of excel)

    The subroutine has Public scope (visible to all modules/procedures including external VBScript call) if it has the word 'Public' in front of the subroutine name or nothing:

    Public Sub...
  11. Re: outlook run time error - extracting emails (body tag)

    Your code doesn't compile for me (undeclared variables). Also, you only need one of the Set olApp statements. Split returns a zero-based array, so the For loop should start at 0, unless you are...
  12. Replies
    15
    Views
    6,779

    Re: outlook VBA popup with select box

    Outlook has userforms, and the available controls (text box, combo box, etc.) are the same as the userforms in Excel. You populate them with the appropriate Outlook object properties instead of...
  13. Re: Running Excel Macro From VBS (with 2 versions of excel)

    CreateRepotversion2. Spelling mistake? Is the subroutine in a module? Is it Public?
  14. Re: NewWindow2 Event for Internet Explorer Control Never Works

    Maybe Sub ExampleRun needs to wait until the new window has been created:

    Before the Click: Set IE2 = Nothing

    After the wait: Do While IE2 Is Nothing: DoEvents: Loop

    and for the NewWindow2...
  15. Re: [HTA] How to hide the CMD prompt on HTA Script ?

    Redirect command output to a temporary file, run the command with objShell.Run instead of objShell.Exec, specifying the hide window option, then read the file using FileSystemObject.
  16. MsOf03 Re: [outlook] Why are my For Each loops only working with the first item?

    Do you need to use a regex? If not, try calling this function:

    Function Validate_File_Name(ByVal fileName As String) As String

    Dim i As Integer, InvalidChars As String

    InvalidChars...
  17. Replies
    1
    Views
    2,751

    Re: Type Mismatch error.

    Please post your code within
    [/CODE ] tags without the spaces.

    Try:
    [code]If Radio(0).Checked Then
    Msgbox "XP"
    'objTSEnvironment("InstallOS") = "2"
    ElseIf Radio(1).Checked Then...
  18. Re: How to give variable folder path in vbscript?

    Use FileSystemObject OpenTextFile and ReadLine to loop through the text file, using the folder string read from the file instead of your hard-coded folder name. Put the CreateTextFile before the...
  19. Replies
    1
    Views
    2,291

    Re: convert multiple excel spreadsheets to csv

    Try something like this (untested):

    For Each objWorksheet In objExcelBook.Worksheets
    objWorksheet.Copy
    objExcel.ActiveWorkbook.SaveAs "theFileName.csv", 23
    objExcel.ActiveWorkbook.Close...
  20. Re: Having an issue with VBScript for a class, help appreciated!

    Your code is a combination of VBScript and pseudocode, so it's not surprising that it doesn't work.
    The error says that the problem is on line 42, which is:


    Display Prompt "Please Enter the...
  21. Re: VBScript to bring back length of sound files.

    For a recursive function to find all files in all subfolders of a start folder see...
  22. Re: Change string in textfile to be incremented

    Have a look at the Split function to separate the octets, then concatenate the modified parts or use the Join function.
  23. Replies
    1
    Views
    451

    Re: VB script to determine file revisions

    Search for FileSystemObject recursive folders as the basis for your script. Everything you describe can be done with the appropriate FSO objects, properties and methods.
  24. Re: InputBox to check then write to line of a file

    Most of this can be achieved using FileSystemObject properties and methods - http://msdn.microsoft.com/en-us/library/6kxy1a51%28v=VS.84%29.aspx.

    1. Call FSO.FileExists.
    2. File.OpenAsTextStream,...
  25. Replies
    2
    Views
    7,591

    Re: how to include default outlook signature

    See if the code here helps - http://www.rondebruin.nl/mail/folder3/signature.htm

    It's written in VBA but should be fairly easy to port to VBScript.
  26. Re: Delete Registry Key with Subkeys using an Array

    See http://www.winvistatips.com/delete-key-subkeys-t753247.html

    and call it thus:



    For i = 0 To UBound(arr_RegKeys)
    DeleteRegistryKey HKEY_CLASSES_ROOT, arr_RegKeys(i,0)
    NextBut why are...
  27. Replies
    3
    Views
    7,087

    Re: Pass variables from .bat file to vbscript

    Get command line arguments using WScript.Arguments within the .vbs file.
  28. Re: need help with filesys.copyfolder error handling

    Without me seeing the Robocopy help, try deleting the second quote. Arguments containing spaces might need to be surrounded by quotes - use Chr(34) for this - again check the help.
  29. Replies
    4
    Views
    1,389

    Re: Looping and iterating variables

    Referring to your first post, call the MonthName function in a loop, like this:

    For i = 11 To 12

    strSQL = "INSERT INTO " & _
    strWorkTableName & " " & _
    "(PartitionKey, CatKey,...
  30. Replies
    4
    Views
    1,389

    Re: Looping and iterating variables

    Because that concatenates the string literal "strSQL" and the variable i. You can't do that in VBScript to generate variable names.

    I'm not sure why you need a loop with the code you've shown. ...
  31. Re: Read Part of an HTML Link and InvokeMember-Click

    You posted in the wrong forum then. The forums are arranged by programming language, not topic. But you got there in the end.
  32. Re: Help Needed - Vb Script Delete Folders If SubFolders Are Empty

    FileSystemObject DeleteFolder.

    Post your code if you need help.
  33. Re: Read Part of an HTML Link and InvokeMember-Click

    Loop through WebBrowser1.Document.Links (each link is a HTMLAnchorElement) looking for the link with innerText starting with "Download file from CANSIM (CSV Version". Call the Click method on that...
  34. Replies
    18
    Views
    8,556

    MsOf03 Re: Excel Image.Picture LoadPicture from url

    For Each myPict In ActiveSheet.Pictures
    If myPict.TopLeftCell = Range("E25") Then myPict.Delete
    Next
  35. Replies
    18
    Views
    8,556

    MsOf03 Re: Excel Image.Picture LoadPicture from url

    Call URLDownloadToFile to download the image to your hard drive and then LoadPicture on the local file.
  36. Re: VBA code to cut a row and append to another row in a loop

    Try this. Assumes data starts in row 1, then row 3, 5, etc.

    Sub Move_Rows()
    Dim row As Long, col As Long

    col = 1
    For row = 1 To 80 Step 2
    Range("A" & row & ":E" &...
  37. Replies
    6
    Views
    714

    Re: Add radio buttons

    VBScript itself does not have any visual elements like radio buttons. You could write an HTML application (http://en.wikipedia.org/wiki/HTML_Application) to do what you want.

    Why do you want...
  38. Re: Adding additional comments to currently available comments

    Doing it with the macro recorder gives the syntax.

    With Selection(i, j)
    If Not .Comment Is Nothing Then .Comment.Text .Comment.Text & vbLf & "Another comment"
    End With
  39. Replies
    1
    Views
    980

    Re: OpenTextFile Question

    OpenTextFile is a method of the FSO class, so:

    .... LogDFS.OpenTextFile(....

    The same applies to CreateTextFile.
  40. Replies
    1
    Views
    664

    MsOf03 Re: filter Outlook item

    Set objItms = objFld.Items.Restrict("@SQL=" & Chr(34) & "urn:schemas:httpmail:subject" & Chr(34) & " Like '&#37;" & MyVar & "%'")
Results 1 to 40 of 208
Page 1 of 6 1 2 3 4



Click Here to Expand Forum to Full Width