Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Picture in Worksheet Question

I have no idea what I am doing and I am in a jam. If anyone can help m
I would be so appreciative!

I am trying to create a user form that will do the following:

1. Allow user to click button to upload picture from a file
2. Make the size of the picture 100 x 87 pixels
3. Have the picture be in cell J13
4. Protect the worksheet and the picture once inserted.
5. Let the user have the option of adding another picture on a ne
worksheet or saving and exiting workbook.

I am very new at using VBA and I am completely stuck all I have so fa
is a form called UploadForm with a button called UploadPhotoButton an
this code:

Private Sub UploadPhotoButton_Click()

Dim bRtn As Boolean

bRtn = Application.Dialogs(xlDialogInsertPicture).Show


If bRtn = False Then Exit Sub

Selection.ShapeRange.Height = 100
Selection.ShapeRange.Width = 87

End Su

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Picture in Worksheet Question

Option Explicit
Sub UploadPhotoButton_Click()

Dim bRtn As Boolean

LineStart:

Range("J13").Select 'If J13 is active, the image will be imported
here.

bRtn = Application.Dialogs(xlDialogInsertPicture).Show


If bRtn = False Then Exit Sub

Selection.ShapeRange.Height = 100
Selection.ShapeRange.Width = 87

ActiveSheet.Protect 'password can be added as well

If MsgBox("Do you want to import another?", vbOKCancel) = vbOK Then
Application.Worksheets.Add
GoTo LineStart
End If

ActiveWorkbook.Close Savechanges:=True,
Filename:=Application.Dialogs(xlDialogSaveAs).Show

End Sub


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Picture in Worksheet Question

Thank you! Works perfectly! I really appreciate it

--
Message posted from http://www.ExcelForum.com

Reply
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
Insert a picture in worksheet baha Excel Discussion (Misc queries) 1 September 28th 09 01:25 PM
How can I insert a picture from file while worksheet is protected ChrisYH Excel Discussion (Misc queries) 0 July 27th 05 04:25 AM
insert picture in header section of excel worksheet bhavini Excel Discussion (Misc queries) 4 February 22nd 05 08:43 PM
Simple Insert Picture question Paul Excel Programming 1 September 15th 03 08:37 PM
insert picture into worksheet cell kiat Excel Programming 0 August 23rd 03 02:41 AM


All times are GMT +1. The time now is 01:00 PM.

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"