Julian has attended:
Excel VBA Intro Intermediate course
Opening a word doc from excel using %USERPROFILE%
Good day to you,
I distribute an exe program every now and then that puts excel & word files into the C: . However we have recently had our administration rights removed. I am however allowed to distribute this into ?CorD?:\Documents and Settings\?persons name?\My Documents .
My excel macro used to read:
Dim wrdApp As Word.Application
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
wrdApp.Documents.Add Template:="C:\Pricing Program\30XA autoquote.dot"
wrdApp.Documents(1).Fields.Update
I tried
Dim wrdApp As Word.Application
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
wrdApp.Documents.Add Template:="%USERPROFILE%\30XA autoquote.dot"
wrdApp.Documents(1).Fields.Update
It sadly doesn't recognise ":="%USERPROFILE%\30XA autoquote.dot" ....have you any ideas.
All the best
Julian
RE: opening a word doc from excel using %USERPROFILE%
Hi Julian
Thanks for your enquiry. It sounds like it might be more helpful to have a conversation with you regarding how you are using the code in your environment, especially as the permissions have changed recently.
I will contact you directly to see if this is something that would be helpful.
Kind regards,
Andrew