+ Reply to Thread
Results 1 to 2 of 2

Print Sheet VBA code not working

  1. #1
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Question Print Sheet VBA code not working

    Hi All,

    I'm familiar with Excel but new to VBA. I'm trying to add a shape to my worksheet and associate a VBA function that will print the active sheet. I've used the following code from another website:

    Please Login or Register  to view this content.
    The code works when I run the macro from the developer menu or when I create a form control. However, when I try to associate this code (written as a module) to a shape (that I want to use as a button), I get the error message "Reference isn't valid". I'm sure there is a very basic tweak I have to make but I'm just beginning with VBA and I dont know what to change so your help would be much appreciated.

    Thank you all for your help

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Print Sheet VBA code not working

    Works for me. See attached
    Attached Files Attached Files

+ 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] Setting Print area with VBA code on active sheet - Can't get my code to work
    By hans302 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2017, 05:07 AM
  2. [SOLVED] Help adding print area code to working macro
    By Rookie2016 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2017, 04:07 PM
  3. VBA code to have print button and print the required area in sheet.
    By Ishwarind in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-09-2016, 03:54 AM
  4. [SOLVED] VBA Code for Print exclude not working
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-23-2016, 01:39 PM
  5. [SOLVED] Private sub code no longer working (print area macro)
    By rikkyshh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2013, 10:43 AM
  6. Code to print columns with active rows not working
    By debbiesh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2009, 05:14 PM
  7. Print Code not working
    By Sheeny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 10:30 AM

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