+ Reply to Thread
Results 1 to 6 of 6

Thread: Opening Workbooks

  1. #1
    Registered User
    Join Date
    08-26-2010
    Location
    Poplar Bluff MO
    MS-Off Ver
    Excel 2007
    Posts
    27

    Opening Workbooks

    I have the following code to open up two workbooks, it goes through the motion, but it doesn't actually open them up. I can't figure out what is wrong. Your help will be greatly appreciated.

    Sub DAformat()
    'Turn off warnings, etc.
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
        
    FileOpenNameTB = "False"
    FileSaveName = "False"
    GoodData = False
    Sat = False
    DAImport:
    FileOpenNameDA = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*", 1, "Open DA Excel File")
            
    FileOpenNameDA = ActiveWorkbook.Name
    
    FileOpenNameTB = "False"
    FileSaveName = "False"
    GoodData = False
    Sat = False
    ETImport:
    FileOpenNameET = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*", 1, "Open ET Excel File")
    
    FileOpenNameET = ActiveWorkbook.Name
        
    End Sub
    Last edited by exc1967; 02-13-2012 at 09:11 AM.

  2. #2
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Opening Workbooks

    Please put code tags around your code in accordance with the forum rules, then we can tell you.
    Good luck.

  3. #3
    Registered User
    Join Date
    08-26-2010
    Location
    Poplar Bluff MO
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Opening Workbooks

    I apologize. I need some help here. I see the instructions, but when I go to advanced, I do not see how to add the tags. If I read it correctly, I need to add [#], but I do not see that anywhere. This is the first time I have posted code.

  4. #4
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Opening Workbooks

    Edit your original post and put
    [code]
    before the code and then
    [/code]
    after the code, then save it.
    Good luck.

  5. #5
    Registered User
    Join Date
    08-26-2010
    Location
    Poplar Bluff MO
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Opening Workbooks

    I do not think it is, so I think it would be around a 2.

  6. #6
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Opening Workbooks


    GetOpenFileName does merely that - it gets the name of a file to open, but it does not open it. You have to do that yourself.
    FileOpenNameDA = Application.GetOpenFilename("Excel Files (*.xl*),*.xl*", 1, "Open DA Excel File")
    If FileOpenNameDA <> False then workbooks.open FileOpenNameDA
    Good luck.

+ 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.2.0