98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Opening a word doc from excel using %USERPROFILE% | VBA forum
vba courses london - Opening a word doc from excel using %USERPROFILE% | VBA forum
Resolved · Low Priority · Version Standard
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Count the Rows and Columns in a SelectionIf you need to count the number of rows or columns in a worksheet use the following code: |