Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Mid Function with XlInsertObject Hlp!

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Mid Function with XlInsertObject Hlp!

try using this method instead

chDrive = "C"
chDir = "C:\temp"
sFileName = Application.GetOpenFilename()




"Joyce" wrote:

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Mid Function with XlInsertObject Hlp!

Hi Patrick,
Thanks for your response. Unfortunately, I couldn't get that to work. I
get an error message - Path Not Found on the line with chDir "C:temp"

Dim SFileName As String
ChDrive "C"
ChDir "C:\temp"
SFileName = Application.GetOpenFilename()


"Patrick Molloy" wrote:

try using this method instead

chDrive = "C"
chDir = "C:\temp"
sFileName = Application.GetOpenFilename()




"Joyce" wrote:

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Mid Function with XlInsertObject Hlp!

well of course not. you need to point where your files are. That was my
example, plus you need the '\'

"Joyce" wrote:

Hi Patrick,
Thanks for your response. Unfortunately, I couldn't get that to work. I
get an error message - Path Not Found on the line with chDir "C:temp"

Dim SFileName As String
ChDrive "C"
ChDir "C:\temp"
SFileName = Application.GetOpenFilename()


"Patrick Molloy" wrote:

try using this method instead

chDrive = "C"
chDir = "C:\temp"
sFileName = Application.GetOpenFilename()




"Joyce" wrote:

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Mid Function with XlInsertObject Hlp!

Hi Patrick,

Sorry for my lack of skills. I'll keep trying.

This will be on different computers, but I'd like the dialog box to simply
open into My Documents. The users can navigate from there.

Thanks.

"Patrick Molloy" wrote:

well of course not. you need to point where your files are. That was my
example, plus you need the '\'

"Joyce" wrote:

Hi Patrick,
Thanks for your response. Unfortunately, I couldn't get that to work. I
get an error message - Path Not Found on the line with chDir "C:temp"

Dim SFileName As String
ChDrive "C"
ChDir "C:\temp"
SFileName = Application.GetOpenFilename()


"Patrick Molloy" wrote:

try using this method instead

chDrive = "C"
chDir = "C:\temp"
sFileName = Application.GetOpenFilename()




"Joyce" wrote:

Hi there,

I'm trying to use XlInsertObject to bring the user to the Insert File
dialog, with display as icon True and Link False.

I'd like to display the name of the fall (not the entire path) as the label.
I've tried to incorporate the Mid function into the code, but am failing
miserably.

Dim FName As String
Application.Dialogs(xlDialogInsertObject).Show , , , True, , , ,
"=Mid(FName, InStrRev(FName, " \ ") + 1)"

Thanks.

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
User Function Question: Collect Condition in Dialog Box - But How toInsert into Function Equation? SteveM Excel Programming 1 January 3rd 08 03:45 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 11:46 PM.

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

About Us

"It's about Microsoft Excel"