Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Logo Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oggy - 08 Apr 2008 20:30 GMT
Hi

I have the following code to insert a logo into a spreadsheet. This is
anyone of three a user will choose from.

My problem is i want a macro to toggle the visibility of the logo on
or off. I have not been able name the logo to then turn it off.

Have i gone about this the wrong way?

Any code pointing me in the right direction would be much appreciated.

Sub logo()
 'insert the logo

Dim logo As Picture
   With Range("f1")
       Set logo = .Parent.Pictures.Insert("H:\Administration
\logo1.bmp")
       logo.Top = .Top
       logo.Left = .Left
          End With
End Sub

Sub logotoggle()

if logo.Visible = False then logo.Visible = true
else
logo.Visible = False
end if

end sub
Ken Johnson - 09 Apr 2008 00:10 GMT
> Hi
>
[quoted text clipped - 28 lines]
>
> end sub

I got "Ambiguous Name" error so I changed Picture variable name to
logo1
The logo1 variable needed to be declared as Public in the Declaration
section of the module (above the first Sub).
I also simplified the toggle code.

Public logo1 As Picture
Sub logo()
 'insert the logo
   With Range("f1")
       Set logo1 = .Parent.Pictures.Insert("H:\Administration
\logo1.bmp")
       logo1.Top = .Top
       logo1.Left = .Left
          End With
End Sub

Sub logotoggle()

logo1.Visible = Not logo1.Visible

End Sub

Ken Johnson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.