+ Reply to Thread
Results 1 to 3 of 3

Can't Set workbook to ActiveWorkbook

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    19

    Can't Set workbook to ActiveWorkbook

    Hi, for some reason I'm not able to set a workbook to ActiveWorkbook, it appears as "activeworkbook" thus the macro does not function.
    
    Dim Macrobook As Workbook
        Dim wb2 As Workbook
        Dim rngCell As Range
        Dim macrosheet As Worksheet
        Dim ws2 As Worksheet
        
        Application.ScreenUpdating = False
        Set Macrobook = activeworkbook
        Set macrosheet = Macrobook.ActiveSheet

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Can't Set workbook to ActiveWorkbook

    Have you called anything else, eg variable, sub, module..., 'activeworkbook anywhere else in the code/workbook?
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Can't Set workbook to ActiveWorkbook

    ThisWorkbook.Activate will set the workbook with the code to the active book
    Elegant Simplicity............. Not Always

+ 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