Hi everyone,
I have tried a few different ways to get this to work but allas no success so far. My original code involved the complete directory path to open a word file,
similar to my last post, i do not wish to have to put the complete dir path into my vba, as this would involve me changing code for different users computers.
is there away to point to a folder without using the whole dir. see code below, i did try USERPROFILE, but failed couldnt find the path/file
Thanks in advance for any help with this one
I have tried a few different ways to get this to work but allas no success so far. My original code involved the complete directory path to open a word file,
similar to my last post, i do not wish to have to put the complete dir path into my vba, as this would involve me changing code for different users computers.
is there away to point to a folder without using the whole dir. see code below, i did try USERPROFILE, but failed couldnt find the path/file
Thanks in advance for any help with this one
VBA Code:
Sub Open_Word_Document()
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "C:\Users\Users Name\Desktop\My Social Club\clubs constitution.docx"
End Sub