Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long File Names/Folders

Status
Not open for further replies.

BobChesh

Technical User
Dec 13, 2001
39
GB
I am trying to open Excel from Access 97 on an NT o/s, using the RunApp macro command. I can get Excel to open, but since the sheet that I want is deeper than the root directory, I have problems getting there. It would seem that I am limited to 6 characters for the folder name, and anything longer is replaced by the tilde character (~), but this can only be used once. So how can I open a sheet that is in say S:\Business\BusinessFaults\Oftelfaults\oftel.xls? as S:\Busine~1\Busine~1\oftelf~1\oftel.xls does not work.

Cheers

BobC
 
You could do it via code rather than a macro - and then run the code from the macro if necessary - this should work:

Option Compare Database
Option Explicit
Sub OpenExcel()

Dim objExcelApp As New Excel.Application
Dim objExcel As Object
'create Excel
Set objExcelApp = New Excel.Application
'open file
Set objExcel = objExcelApp.Workbooks.Open("S:\Business\BusinessFaults\Oftelfaults\oftel.xls")
objExcelApp.Visible = True
end sub

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
Geoff,

Brill. It works, sort of.

Since I got an error, I converted my macro to code, then changed the path and all is well.

Thanks, that has saved me a lot of heartache, and the cause of numerous other problems I have elsewhere.

Bob C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top