Search:

Type: Posts; User: John_w; Keyword(s):

Page 1 of 6 1 2 3 4

Search: Search took 0.28 seconds.

  1. Re: Does A Variation Of A Filename Exist In A Directory

    Maybe you didn't know, but asterisk is a wildcard character in the Dir function, representing 0 or more characters. So your code, as posted, should determine whether any of the three variations...
  2. Replies
    2
    Views
    37

    Re: Open and space two folders

    The forum software has removed the back slashes from the Get_Explorer_hWnd function. Here is the function with BACK SLASH in place of them, which you must replace with a back slash character.

    ...
  3. Replies
    2
    Views
    37

    Re: Open and space two folders

    Try this Open_and_Position_2_Explorer_Windows macro - put all the code in a standard module. I've included your FinalPath and DTPath variables - edit the code where stated, but you'll have to...
  4. Replies
    4
    Views
    61

    Re: Open 2 Matching Files in Folder & Loop

    Try this macro. Please note the Option Compare Text statement above the procedure - this makes the Like operator (and string comparisons with Left, Right, etc.) case-insensitive. Also, I've...
  5. Re: search folder for latest file creation date, not latest modified date

    Yes. Have you tried it?
  6. Replies
    4
    Views
    61

    Re: Open 2 Matching Files in Folder & Loop

    You can't have 2 Dir calls in the same loop because the 2nd Dir call loses the context of the 1st Dir call. The solution is to have a more general wildcard filespec for the Dir loop and put the...
  7. Re: Copy data range to a dynamic target worksheet and range

    In that case we can use your idea of reading the required month from a cell. In this code, cell A2 in sheet "Macro set up" in the macro workbook is expected to contain any date in the required month...
  8. Re: search folder for latest file creation date, not latest modified date

    We have to use FileSystemObject to determine a file's creation date. Add this function:


    Public Function Get_Latest_Workbook(searchPath As String) As String

    Dim FSO As Object
    Dim...
  9. Thread: Auto-Save issue

    by John_w
    Replies
    2
    Views
    57

    Re: Auto-Save issue

    The problem is that your Workbook_Open calls OnTime without saving the time in the dTime variable, so if you close the workbook within 2 minutes of opening it the AutoDeactivate routine doesn't...
  10. Replies
    4
    Views
    143

    Re: Email Code to Email Active XLSX sheet

    Try this macro:

    Public Sub Email_Active_Sheet()

    Dim wb As Workbook
    Dim p As Long, tempWorkbookFullName As String
    Dim emailSubject As String
    Dim oApp As Object, oMail As...
  11. Re: Copy data range to a dynamic target worksheet and range

    These file names are not consistent - the first has 4 letters for the month and the year is specified, whereas the second has 3 letters for the month and no year.

    With the file names as Sep...
  12. Re: VBA saving tab in new workbook but button linked to old

    You have to change the button's OnAction property in the new workbook to include the full name of the new workbook. For example:

    Public Sub Save_Sheet()

    Dim clickedButton As Button
    Dim...
  13. Replies
    2
    Views
    136

    Re: Changing Font Type in Header VBA Code

    Try this:

    .PageSetup.RightHeader = "&""Times New Roman,Regular"" " & Format(Now, "YYYY") & " " & prevQtr & qtrEndingDate
    If you want an explicit font size (e.g. 8):

    ...
  14. Re: Using UIAutomationClient to automate the Save As file download in IE11

    UPDATE - Here is a list of useful links for UI Automation:

    UI Automation introduction
    https://docs.microsoft.com/en-gb/windows/desktop/WinAuto/entry-uiauto-win32

    UI Automation Fundamentals...
  15. Replies
    3
    Views
    133

    Re: printing userform landscape and on a4

    What have you tried?

    There are some ideas in http://www.mrexcel.com/forum/excel-questions/331211-save-userform-bmp.html, including a couple of linked pages.
  16. Replies
    3
    Views
    106

    Re: Showing .pdf file in folder with my code

    This can be done with the Shell BrowseForFolder method and specifying the BIF_BROWSEINCLUDEFILES flag so that the browser displays files and folders.

    Add this code to a new module:

    Option...
  17. Replies
    12
    Views
    257

    Re: VBA - get active printer status

    Add Dim statements. Data types should be obvious from the variable names - str is String, obj is Object, etc.

    I don't know about the active printer. Perhaps there is a property at...
  18. Replies
    10
    Views
    206

    Re: VBA table TotalsRowRange cells

    Try this:

    With myTable
    .TotalsRowRange(.ListColumns("Stake").Index).Select
    End With
  19. Replies
    12
    Views
    257

    Re: VBA - get active printer status

    That code is VBScript - change every Wscript.Echo to Debug.Print for VBA. You'll also need to declare the variables if you're using Option Explicit.
  20. Replies
    12
    Views
    257

    Re: VBA - get active printer status

    You can use WMI - https://www.pcreview.co.uk/threads/is-wmi-printerstatus-in-win32_printer-reliable.2434571/
  21. Re: VBA to fill array with delimited data from text file

    Your thread title and initial code is at odds with your overall aim, and the code posted so far will only import the data from one text file.

    This macro effectively uses the Text Import Wizard to...
  22. Replies
    3
    Views
    88

    Re: Auto Creation of Folders in .pst File

    You have to add the .pst file as a Store to Outlook (temporarily) and then you can add the new folder to the Store.

    Try this macro:

    Public Sub Add_Folder_To_pst_File()

    Dim outApp As...
  23. Re: VBA to refresh power query then resume macro once the refresh is done

    The Connection.OLEDBConnection object is defined only if the connection type for that connection is OLEDB. Therefore change the loop to:

    For Each Connection In...
  24. Re: VBA to fill array with delimited data from text file

    Swap the row and column dimensions in the ReDim Preserve, like this:

    ReDim Preserve DataArray(rw, col)
  25. Re: Import each Email from outlook into the next row of excel

    Untested. As well as the Offset change, replace:

    Range("Body_of_Email").Offset(1, 0).Value = OutlookMail.Bodywith:

    Dim lines As Variant, r As Long
    lines = Split(OutlookMail.Body, vbCrLf)
    For...
Results 1 to 25 of 150
Page 1 of 6 1 2 3 4