+ Reply to Thread
Results 1 to 4 of 4

VBA Update - Declaring Worksheets and Ranges

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA Update - Declaring Worksheets and Ranges

    Hi all,

    I am a novice programmer and recently an update of windows and office has caused some issues. So it was working on VBA6 and Office 2007, but not on VBA 7.1 / Office 2016.

    This sub is designed to grab the last active reminder in Outlook, and then find the corresponding customer in an excel database, then go to that cell.

    It now fails on declaring the worksheet "User type not defined" which I got around by declaring 'ws' as an object instead of a worksheet... not sure if this helps or not though.

    Then Rng now seems to not find anything, nor will it go to the found cell...


    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Update - Declaring Worksheets and Ranges

    Hi,

    It sounds like you don't have a reference set to the Excel object library, using Tools- References in the VBE.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA Update - Declaring Worksheets and Ranges

    Hi xlnitwit,

    I thought that, but I copied all the references we had previously. And then when it failed, I scrolled through to find anything that may hold the reference to excel... so unless it is not obvious, I don't think it would be that.

    I found the below article, which mentions at the bottom referencing access as an object and "Some applications don't recognize individual Microsoft Access object types" and was wondering if this might be similar to my experience with referencing excel from outlook???

    https://msdn.microsoft.com/en-us/vba...ring-variables

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Update - Declaring Worksheets and Ranges

    If you had a reference set to Excel, you wouldn't get an error when declaring ws as Worksheet. What references are checked in the Outlook project?

+ 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. [SOLVED] VBA created Ranges that i can update
    By Sparkplug90 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2014, 10:50 AM
  2. [SOLVED] Create code to update named ranges in a table. Table contains Many Name Ranges
    By Calio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2014, 11:13 AM
  3. Help, When inserting a new row SUM ranges do not update.
    By Tesseract42 in forum Excel General
    Replies: 5
    Last Post: 06-03-2013, 01:52 PM
  4. Replies: 0
    Last Post: 10-15-2012, 07:24 AM
  5. Replies: 0
    Last Post: 07-06-2006, 12:00 AM
  6. [SOLVED] Update Named Ranges
    By Raul in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:20 PM
  7. [SOLVED] Trouble with Declaring Worksheets
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-10-2005, 05:05 AM
  8. [SOLVED] Automation to update 288 ranges?
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 07-12-2005, 07:05 PM

Tags for this Thread

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