ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problems with "CurDir" (https://www.excelbanter.com/excel-programming/444130-problems-curdir.html)

cubbybear3

problems with "CurDir"
 
I have the following code from Excel 2003 and can not seem
to get it to work in Excel 2007.
I get the error "Can't find project or library" on "CurDir".
Any clues as to what I am doing wrong or what it got changed to?

' save the Drive letter and path
strTmp =
ActiveSheet.Evaluate(ActiveWorkbook.Names("drive.p ath").RefersTo)(1)
If (strTmp < Application.Workbook.Path) Then
ActiveWorkbook.Names.Add Name:="drive.path", RefersToR1C1:= _
"={" & Chr(34) & Application.Workbook.Path & Chr(34) & "}"
End If

GS[_2_]

problems with "CurDir"
 
cubbybear3 submitted this idea :
Application.Workbook.Path



I'm doubtful that this code works in any version of Excel since this
isn't supported by Excel.

And what's with the curly brackets in the RefersTo?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc



Peter T[_5_]

problems with "CurDir"
 
You posted some code but it does not include "CurDir", which is where you
say you are getting the error.

Look in Tools, References, I suspect you have one marked MISSING.

Regards,
Peter T


"cubbybear3" wrote in message
...
I have the following code from Excel 2003 and can not seem
to get it to work in Excel 2007.
I get the error "Can't find project or library" on "CurDir".
Any clues as to what I am doing wrong or what it got changed to?

' save the Drive letter and path
strTmp =
ActiveSheet.Evaluate(ActiveWorkbook.Names("drive.p ath").RefersTo)(1)
If (strTmp < Application.Workbook.Path) Then
ActiveWorkbook.Names.Add Name:="drive.path", RefersToR1C1:= _
"={" & Chr(34) & Application.Workbook.Path & Chr(34) & "}"
End If




All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com