ask2tsp
Well-known Member
- Joined
- Feb 18, 2015
- Messages
- 506
- Office Version
- 365
- Platform
- Windows
T
o create files in the folder where the workbook is located
Thisworkbook.Path is the preferred choice, but that gives errors with Office/365 and onedrive.
In my case Thisworkbook.Path=
"https://d.docs.live.net/beccd3471f9cbf60/Documenten/code snippets/Symbol table"
local (in my laptop) this is
"D:\OneDrive\Documenten\code snippets\Symbol table"
results in
"Documenten\code snippets\Symbol table"
Now prepend "D:\OneDrive" (everything in this folder is synced with onedrive)
and I get a path I can use with fspenTextFile
Is this "D:\OneDrive" value retrievable somewhere?
And to make this work with different exel versions (2013 and later) how to code that?
o create files in the folder where the workbook is located
Thisworkbook.Path is the preferred choice, but that gives errors with Office/365 and onedrive.
In my case Thisworkbook.Path=
"https://d.docs.live.net/beccd3471f9cbf60/Documenten/code snippets/Symbol table"
local (in my laptop) this is
"D:\OneDrive\Documenten\code snippets\Symbol table"
Code:
replace(mid(Thisworkbook.Path,instr(Thisworkbook.Path,split(Thisworkbook.Path,"/")(4))),"/","\")
"Documenten\code snippets\Symbol table"
Now prepend "D:\OneDrive" (everything in this folder is synced with onedrive)
and I get a path I can use with fspenTextFile
Is this "D:\OneDrive" value retrievable somewhere?
And to make this work with different exel versions (2013 and later) how to code that?