LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
PS PS is offline
external usenet poster
 
Posts: 18
Default using, referencing bmp in spreadsheets

Here's some code. Some of it I did by "recording", for the rest I winged it.
I
get fowled up at the end... each time the sheet updates, the .bmps are
reinserted. I was trying to find the company name & if it's there, replace
it
with the bmp. Then, the next time the sheet is updated, if the bmp is there,
I don't want it to do anything. (This is just a small portion of a very
large set of macros which perform some automation.)

Up to the ElseIF portion it seems to run fine, but I don't know how to stop
the code from reinserting the bmps, so I thought I could have it search for
the "extra" set each time and just delete it.

If anyone can help, I'd be obliged. (Does the "recorder" add
extraneous information -- more than you need to know?" It just seems so
cumbersome.)

Here's the code... thanks again, PS

Cells.Find(What:="ABC Co", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
If ActiveCell.Value = "ABC Co" Then
Selection.ClearContents
ActiveSheet.Pictures.Insert("C:\Documents and Settings\PS\Desktop\ABC
Co\FileTransfer\Xmtls\XmtlLogo-DoNotRelocate.bmp").Select
' ActiveSheet.Pictures.Insert("H:\misc\XmtlLogo-DoNotRelocate.bmp").Select
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 12#
Selection.ShapeRange.Width = 78#
Selection.ShapeRange.Rotation = 0#
Selection.Name = "Logo"
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.ShapeRange.IncrementTop 0.75
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
ActiveCell.Select
ActiveSheet.Pictures.Insert("C:\Documents and Settings\PS\Desktop\ABC
Co\FileTransfer\Xmtls\Xmtl-em-DoNoRelocate.bmp").Select
' ActiveSheet.Pictures.Insert("H:\misc\Xmtl-em-DoNoRelocate.bmp").Select
Selection.Name = "EMsign"
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
Selection.ShapeRange.IncrementTop 0.75
Selection.ShapeRange.IncrementTop 0.75
Selection.ShapeRange.IncrementTop 0.75

ElseIf ActiveSheet.Shapes.Find(What:="Logo", After:=ActiveCell,
LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate Then
ActiveSheet.Shapes(Array("Logo", "EMsign")).Delete

Sheets("TRANSMITAL").Select
End If

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios _
:=True
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indirect referencing of external spreadsheets GSM Excel Discussion (Misc queries) 4 February 16th 08 01:59 PM
Indirect referencing closed spreadsheets GSM Excel Discussion (Misc queries) 1 February 14th 08 02:41 PM
Spreadsheets referencing Obsolete Drive Mappings chessexpert Excel Discussion (Misc queries) 1 October 31st 07 12:00 AM
Extracting or Referencing named cells in multiple spreadsheets Bonehead Excel Discussion (Misc queries) 3 November 27th 06 07:18 PM
Copying Spreadsheets without referencing other workbook. [email protected] Excel Worksheet Functions 8 July 26th 06 12:46 PM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"