Hi there,
I am trying to get the full path incl filename an dextension of Excel files that are open and store the result in a text file. When I put the code into an Excel macro it will work fine but when I put it into a VB app on its own it gives an error of "Object Variable or With block variable not set".
The code that I am using is below:
Dim xlFilePath as String
Set xlFilePath = ActiveWorkbook.Path
Open "c:\Program Files\xlFilePath.txt" For Output As 1
Print #1, xlFilePath
Close 1
Any help is much appreciated,
Cormac.
I am trying to get the full path incl filename an dextension of Excel files that are open and store the result in a text file. When I put the code into an Excel macro it will work fine but when I put it into a VB app on its own it gives an error of "Object Variable or With block variable not set".
The code that I am using is below:
Dim xlFilePath as String
Set xlFilePath = ActiveWorkbook.Path
Open "c:\Program Files\xlFilePath.txt" For Output As 1
Print #1, xlFilePath
Close 1
Any help is much appreciated,
Cormac.