+ Reply to Thread
Results 1 to 9 of 9

to delete a png after inserting it

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    to delete a png after inserting it

    i have a macro that is currently inserting a watermark, and then it prints out a sheet. I want to add another step to it, which is to delete the watermark after it prints, here is the code
    Please Login or Register  to view this content.
    please help, thank you.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: to delete a png after inserting it

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: to delete a png after inserting it

    that works, thank you, so you dim it as a picture, and then just delete it , what if i have 2 pictures on there would it matter?

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: to delete a png after inserting it

    Hi chubbychub,

    For two pictures, use pic1 and pic2.

    Lewis

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: to delete a png after inserting it

    so I will add this line:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: to delete a png after inserting it

    Please Login or Register  to view this content.

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: to delete a png after inserting it

    @chubbychub,
    Thanks for the rep.points.

    As LJMetzger described, you can use 2 "pic datatype" variables for the purpose.

    In VBA language, you must assign every single variable name with its target datatype.
    If you don't assign anything to the variable name, that variable name is automatically become "variant" datatype.

    So, if you want pic1 and pic2 to have a "pic datatype", you should define it like this :
    Please Login or Register  to view this content.
    If you define them like this :
    Please Login or Register  to view this content.
    VBA will assume pic1 as "variant" datatype, because you don't assign any datatype to it.

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: to delete a png after inserting it

    ok, thank you for the teachings.

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: to delete a png after inserting it

    You are welcome, glad to help.


    Regards

+ 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. Replies: 0
    Last Post: 05-20-2014, 11:58 AM
  2. [SOLVED] Modify code to delete old picture first before inserting new one
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-15-2013, 02:18 PM
  3. Inserting a row in a range will delete a row elsewhere?
    By Djarn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2012, 02:20 PM
  4. Replies: 6
    Last Post: 08-29-2010, 08:15 AM
  5. inserting cells into a hyperlink, inserting link via macro
    By jackmc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2007, 12:02 AM
  6. [SOLVED] Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  7. Replies: 0
    Last Post: 06-21-2005, 01:05 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