Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 9th, 2003, 12:16 PM
malb4uk malb4uk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 14 malb4uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Check if the picture is in the cell?

Hi, I have a macro, which inserts pictures into the cell. The problem that I have is if the picture has already been inserted, another picture is inserted as well. I am inserting pictures of jewlery, and each jewlery has one style with different stones. I check for the first available style and insert the picture, but if another same style occurs, another picture is inserted over the previous pictures into the same cell. Here is part of my code, where I check if the cell is empty, but it doesn't seem to work. :

Dim sFilename as String
Dim spath as String
Dim sFilename3 As String
spath = "P:\Pictures\JPG\"
sFilename = Worksheets(1).Cells(i, 2).Value 'the name of file
sFilename3 = Worksheets(1).Cells(i, 1).Value 'for checking if cell is
'empty
sFilename = spath + sFilename + "aq" + ".jpg"
If oFSo.fileExists(sFilename) And sFilename3 = "" Then
ActiveSheet.Pictures.Insert(sFilename).Select
'inserts picture and select it
Selection.ShapeRange.ScaleWidth 1.3, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.3, msoFalse, msoScaleFromTopLefI apreciate your help in advance. Thanks so much.

Last edited by malb4uk : September 10th, 2003 at 08:32 AM.

Reply With Quote
  #2  
Old September 9th, 2003, 11:48 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Sorry!Can you tell me more detail about the code??...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Check if the picture is in the cell?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT