Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro with manual file selection?


I would like to create a macro that will insert a manually selected
image from specific directory using Excell 2002. In other words I would
like to be able to execute a macro that will take me to a predetermined
directory and will pause for manual selection of an image file. Using
the "Record New Macro" function It is easy to set up a macro that will
insert the same image over and over again.


ActiveSheet.Pictures.Insert("\\Fileserver\otprints \ADV03(LFM-0900,C).jpg").
_
Select
End Sub

I'm sure what I am trying to do is more complicated then the simple
macro above.

Can anyone help me out with this?

Thank You,

Paul


--
Pmedina
------------------------------------------------------------------------
Pmedina's Profile: http://www.excelforum.com/member.php...o&userid=24552
View this thread: http://www.excelforum.com/showthread...hreadid=381679

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro with manual file selection?


This code should give you what you want.


Code:
--------------------
Sub InsertSelectedPicture()
Dim selFile As String
Dim myDir As String
myDir = "\\Fileserver\otprints"
ChDir (myDir)
selFile = Application.GetOpenFilename("JPG Files (*.jpg),*.jpg,All Files (*.*),*.*")
ActiveSheet.Pictures.Insert (selFile)
End Sub
--------------------


See VBA help to see the different options for the file filter types
that can be used.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=381679

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro with manual file selection?


bhofsetz,

Thanks. You made that look easy. I had no problems using your code.

Pau

--
Pmedin
-----------------------------------------------------------------------
Pmedina's Profile: http://www.excelforum.com/member.php...fo&userid=2455
View this thread: http://www.excelforum.com/showthread.php?threadid=38167

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
Manual Selection 1 or the other Lazarus Excel Discussion (Misc queries) 2 August 29th 06 11:02 PM
Macro resets my calculation to manual Hari[_3_] Excel Programming 11 June 16th 04 03:59 AM
Need help with macro to save selection to csv file! SergeMN Excel Programming 0 May 17th 04 05:32 PM
Manual Input During Macro Execution Sherlock[_2_] Excel Programming 5 April 27th 04 04:59 PM
Macro vs Manual save event David Sedberry Excel Programming 2 September 25th 03 06:05 PM


All times are GMT +1. The time now is 05:48 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"