اذهب الي المحتوي
أوفيسنا

فتح مسار معين في كل مرة


Akram Galal

الردود الموصى بها

  • الحل منقول للأمانة :-
Sub  Example()
Dim  intChoice As  Integer 

'Select the start folder 
Application.FileDialog(msoFileDialogOpen _
 ).InitialFileName = "D:TempFolder to Start" 
'make the file dialog visible to the user 
intChoice = Application.FileDialog(msoFileDialogOpen).Show
'determine what choice the user made 
If  intChoice <> 0 Then 
 'your code here 
End If 
End  Sub 

 

excel-vba-open-file-dialog-start-folder1.png

رابط هذا التعليق
شارك

وعليكم السلام

تفضل ولكن عليك بتغيير المسار داخل الكود الى ما تريده

Sub openwb()
    Dim sPath As String, sFile As String
    Dim wb As Workbook

    sPath = "D:\sarath\PTMetrics\20131004\D8 L538-L550 16MY\"
    sFile = sPath & "D8 L538-L550_16MY_Powertrain Metrics_20131002.xlsm"

    Set wb = Workbooks.Open(sFile)
End Sub

 

  • Like 2
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information