+ Reply to Thread
Results 1 to 3 of 3

Show dialog window

Hybrid View

mohan.r1980 Show dialog window 11-15-2010, 02:51 AM
JBeaucaire Re: Show dialog window 11-15-2010, 03:50 AM
mohan.r1980 Re: Show dialog window 11-15-2010, 05:17 AM
  1. #1
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Show dialog window

    Hi Friends,

    Please help me for below code
    first i want tell what i want
    i am lokking a dialog window insted of input box.
    in Inputbox, i put the path where my file tobe save.

    So here i want to dialog box which will save the path in my variable
    Dim outputPath
    outputPath = Application.InputBox("Please Paste The Output Path", "Output Path")
        If outputPath = "" Then
        Exit Sub
        
     Workbooks.Add
         ChDir outputPath
         ActiveWorkbook.SaveAs Filename:= _
            outputPath & "\Merge File.xls", FileFormat:= _
            xlOpenXMLWorkbook, CreateBackup:=False
            Windows("Merge File.xls").Activate
    Last edited by mohan.r1980; 11-15-2010 at 05:17 AM. Reason: Added Code Tags

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Show dialog window

    'Folder selection
        Dim fPath As String
        With Application.FileDialog(msoFileDialogFolderPicker)
            .AllowMultiSelect = False
            .InitialFileName = "C:\2010\"
            .Show
            If .SelectedItems.Count > 0 Then
                fPath = .SelectedItems(1) & "\"
            Else
                MsgBox "No path chosen, aborting."
                Exit Sub
            End If
        End With
    
        Workbooks.Add
         
        ActiveWorkbook.SaveAs Filename:=fPath & "Merge File.xls", _
            FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Show dialog window

    Thank you very much
    it solve my problem
    thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1