Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mike Echo
 
Posts: n/a
Default xlDialogOpen.Show or Activeworkbook.Path?

How can I get a dialog box to open in a certain location using VBA?

My problem happens when users press a button to automatically insert
data from a separate file - if they have been doing things using a
different path then Excel cannot find the data file. Is there an easy
way around this using Activeworkbook.Path or something? The data file is
located in the same directory as the main file.

(I know this group is called worksheet.functions but have found this
group very helpful in the past so please turn a blind eye to my OTness.)

TIA,
R.
  #2   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi R

Sub test()
Dim F As Variant
ChDrive ThisWorkbook.Path
ChDir ThisWorkbook.Path
F = Application.GetOpenFilename _
("Good stuff (*.xls), *.xls")
If F < False Then MsgBox CStr(F)
End Sub

HTH. Best wishes Harald

"Mike Echo" skrev i melding
ne.net.au...
How can I get a dialog box to open in a certain location using VBA?

My problem happens when users press a button to automatically insert
data from a separate file - if they have been doing things using a
different path then Excel cannot find the data file. Is there an easy
way around this using Activeworkbook.Path or something? The data file is
located in the same directory as the main file.

(I know this group is called worksheet.functions but have found this
group very helpful in the past so please turn a blind eye to my OTness.)

TIA,
R.



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



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