+ Reply to Thread
Results 1 to 4 of 4

Script can't connect to Active Workbook / Active sheet

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Script can't connect to Active Workbook / Active sheet

    Hi,

    All of a sudden all my SAP scripts stoppad working. When trying to start the script the same error message appears almost instantly for all my scripts which I have been using for long time.
    I do have only one Excel workbook open before running my scripts but now it is as if the script dosn't notice the open workbook at all....

    Line: 23
    Char: 1
    Error: Object required: 'ActiveWorkbook'
    Code: 800A01A8


    The line is the one highlighted below (Set objSheet = objExcel.ActiveWorkbook.ActiveSheet)
    Please Login or Register  to view this content.

    REM ADDED BY EXCEL *************************************


    Please Login or Register  to view this content.


    Regards
    Cuni
    Attached Images Attached Images
    Last edited by Cuni; 12-19-2019 at 12:15 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Script can't connect to Active Workbook / Active sheet

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: Script can't connect to Active Workbook / Active sheet

    Thank you i will.

    I was/am in a hurry to find solution to this problem ASAP otherwise I will have to do things manually and work till late hours today

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: Script can't connect to Active Workbook / Active sheet

    If you used 'dll references' in Tools\References (vba editor), then check, maybe some process has deactivated them.
    Declare 'objExcel' and 'objSheet' explicitly as 'objects' and maybe additionally with early binding (Excel.Workbook, Excel.Worksheet).
    Maybe your administrator has limited the permissions to run scripts ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. error VBA script trying to bring userform data from different then active sheet
    By archangel9999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 04:34 AM
  2. [SOLVED] Code to detect previous active workbook instead of current active workbook
    By kosherboy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-25-2014, 01:58 AM
  3. [SOLVED] save active sheet in new workbook, naming it as cell value of active sheet
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2014, 06:16 AM
  4. Get number of rows in a active worksheet in a active workbook
    By tamahome90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2012, 09:06 AM
  5. Macro to Print active sheet as PDF to Active workbook and customize name
    By Scott Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2012, 08:52 PM
  6. how can worksheet_activate event of active sheet work of active workbook
    By tahir mahmood in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2011, 08:19 AM
  7. VBA script stops when the workbook is not active.
    By grid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2010, 12:23 PM

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