Peter Chan
asked on
Problem to line
ASKER
I tried with your codes and still encountered the same problem.
The relevant path is correct.
The relevant path is correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I cannot show
Debug.Print File0
in Watch window. What to adjust?
Debug.Print File0
in Watch window. What to adjust?
In Watch window you only type File0, no command.
ASKER
I want to see value of File0 but I get nothing.
To use Watch window, you need to set a breakpoint e.g. at the debug.print line.
ASKER
Debug.Print should still show the value of File0, even if there is no break point, right?
Yes. BUt you need to have the Output window (or whatever it is called) opened to see.
ASKER
I want to refer to current path of Excel file (Within Sharepoint). It seems ActiveWorkbook.Path is not revealing the correct path of current Excel file.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get
due to last line below
it seems Application.ActiveWorkbook .Path is not revealing the correct path of current Excel file being opened.
due to last line below
File0 = Replace(Replace(Application.ActiveWorkbook.Path & "\..\Index\" & File1 & ".txt", "/", "\"), "http:", "")
'File0 = ActiveWorkbook.Path & "\..\Index\" & File1 & ".txt"
Debug.Print Application.ActiveWorkbook.Path
Debug.Print File0
Open File0 For Output As #1
it seems Application.ActiveWorkbook
We might be able to help if you provide example output of the debug print above, as I don't have a clue how SharePoint provides its files.
ASKER
I can't see the real path in the screenshot.
ASKER
ASKER
Any help?
Do you have more than one workbook open, so that the active one is not the one that you are expecting?
In your last snippet, what is the type and value of Window0?
Is it a file name or an index number?
Is it a file name or an index number?
What's the solution?
Open in new window