Posts by ashu1990

    see if this helps


    [SIZE=14px]PictureSizeMode Property
    Another property of the image control is the PictureSizeMode.


    If the property is set to the default value 0-frmPictureSizeModeClip the control size can be changed without the picture size being modified. So you can see only part of the picture or there can be a background behind it in a clolor color you can change at will.


    If the property is set to the 1-frmPictureSizeModeStretch the picture is resized as the control is. The image fills the control.


    If the property is set to the 3-frmPictureSizeModeZoom the picture is resized as the control is but the picture and background are present.


    press like if it worked!!![/SIZE]

    ok here is the problem you are having old file name when it was opened and after you saved the workbook with its new name you did not again loaded the variable with the new file name.


    Code
    Filename = ActiveWorkbook.Name
    ActiveWorkbook.SaveAs Filename:=FolderName & "\" & Replace(myFile, ".txt", ".xlsx"), FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False


    change this to this


    Code
    ActiveWorkbook.SaveAs Filename:=FolderName & "\" & Replace(myFile, ".txt", ".xlsx"), FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    Filename = ActiveWorkbook.Name

    you have to give the file a path hence its saving it in a unknown location, below code will save the file where you have saved your macro file.


    Code
    ActiveWorkbook.SaveAs thisworkbook.path & "\" & Replace(Range("L6").Value & "-" & Range("N2").Value & "-" & Range("A6").Value, ".", "") & ".xlsm", 52

    assuming you have timer in Cell B2 running the below code will work


    in context to what jonathan wanted to say, see below code, also please try to play with your code this is the way you will learn new things.


    this will do the trick removed . and replaced it with space as it hampers saving excel file format ;)


    Code
    ActiveWorkbook.SaveAs Replace(Range("L6").Value & "-" & Range("N2").Value & "-" & Range("A6").Value, ".", "") & ".xlsm", 52

    Hey Home,


    I had this problem too and what you need to do is change the setting of your data connections. By default, Excel will "Enable background refresh". This must be turned off and it will force the macro to complete the refresh task before it moves on. If using Excel 2007, bring up the "Connection Properties" and uncheck the box that enables the background refresh. You can get there by clicking on the table that gets refreshed and where you would click to actually refresh the data you should see an arrow for more options.

    Re: take value from 2 multi listboxes and search row for criteri


    you have to give the value of list box into the lst1 and listbox 2 into lst2...


    lst1 = Me.listbox1.Value lst2 = Me.listbox2.Value <---- see that you are passing the right values here i didnt checked it with list box .


    if the null value passes into this string hopefully it will not run.

    Re: IE Automation: Click button (Object invoked has disconnected from clients)


    if you still did not find a solution try this after you open the url in ie



    this will again set the instance of the ie into the variable, it happens coz you loose the instance of the internet explorer

    Re: Expand Outlook Distribution List using Excel VBA


    try this



    Re: Modify my code to copy ranges to email


    this codes copy charts into email body, hope you will be able to ammend it into yours for your better learning.


    Code
    Sub CopyAndPasteToMailBody()
        Set mailApp = CreateObject("Outlook.Application")
        Set mail = mailApp.CreateItem(olMailItem)
        mail.Display
        Set wEditor = mailApp.ActiveInspector.wordEditor
        ActiveChart.ChartArea.Copy
        wEditor.Application.Selection.Paste
    End Sub