Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to set 'insert picture' default open location

Thank you. This was helpful


"Peter T" <peter_t@discussions wrote in message
...
It looks like the default picture folder is found from an API and seems

that
can't be changed. Following does similar albeit more work.

Sub test()
Dim oldDir As String
Dim lookFldr As String
Dim vFile

lookFldr = "C:\" ' << change

oldDir = CurDir
ChDir lookFldr
'Err.Clear
' add more picture extensions as required
vFile = Application.GetOpenFilename("Picture
Files,*.jpg;*.bmp;*.tif;*.gif", , _
"Insert your wonderful picture in cell " &

ActiveCell.Address(0,
0))
If VarType(vFile) = vbString Then
ActiveSheet.Pictures.Insert vFile
ElseIf VarType(vFile) = vbError Then
MsgBox "GetOpenFilename failed"
Else
'if vfile = false user cancelled
End If

ChDir oldDir
End Sub

Regards,
Peter T

"Jack B. Pollack" wrote in message
...
Hi,

using application.dialogs( xldialoginsertpicture) to open a dialog box.
How
can I control the path that the dialog box open with?






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
Excel will not open in default file location Roger Chapman Excel Discussion (Misc queries) 2 December 8th 10 04:58 PM
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
Copy Chart and Insert in new Sheet as picture over the same location TFriis Excel Programming 1 January 22nd 08 04:27 PM
how do i change the default location of my picture files in Excel Rosie D Excel Discussion (Misc queries) 2 June 4th 06 11:43 AM
default location for files open commands Eric Dreshfield Excel Programming 2 September 15th 03 09:35 PM


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