0

I am trying to open a file in Access. I am in the correct folder location but I am unaware of the file name. In this case I would like to open the file with the extension of .htm. I have seen an example of excel but this doesn't seem to work for me:

FolderPath = GetSignature(Environ("Userprofile") & "\AppData\Roaming\Microsoft\Signatures\")

FileName = Dir(FolderPath & "*.htm")

While FileName <> ""
    Workbooks.Open FolderPath & FileName
    FileName = Dir()
Wend

Does anyone have any suggestions? Thanks in advance.

YowE3K
  • 23,852
  • 7
  • 26
  • 40
gcpreston
  • 135
  • 1
  • 12
  • 2
    What debugging have you done, what is the return of folderpath, filename etc what is the error if you get one? It works for me, what is GetSignature – Nathan_Sav Jul 12 '17 at 10:52
  • [How to debug VBA code](http://www.cpearson.com/excel/DebuggingVBA.aspx) – Andre Jul 12 '17 at 11:12
  • Are you trying to open the file as an Excel "workbook"? Do you have an Excel `Application` object defined? – YowE3K Jul 12 '17 at 19:46

0 Answers0