vba courses london - opening word doc excel
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Opening a word doc from excel using %USERPROFILE%

vba courses london - Opening a word doc from excel using %USERPROFILE%

The UK's most regular instructor-led training courses.
Training information: vba courses london · Excel london

resolvedResolved · Low Priority · Version Standard

Opening a word doc from excel using %USERPROFILE%

Julian has attended:
Excel VBA course

by - delegate Julian [3 posts] (2007 Jan 16 Tue, 11:04) replyReply

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%

by - trainer Andrew platinum contributer[549 posts] (2007 Jan 26 Fri, 11:37) replyReply

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


Related articles

· What Is Microsoft Excel VBA and How Can It Help You Work Smarter?
· Visual Basic Returns To The Macintosh
· How To Find A Good VB For Access Trainer
· Introduction to Visual Basic for Applications
· Company Roles in Visual Basic Training

Vba tip:

Stuck in a Code Loop

If you ever get stuck in an infinite code loop when programing in VBA use

CTRL+BREAK

to exit the procedure

View all VBA hints and tips

Rate this page:
4.0/5 (3 votes cast)
Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information

Training Articles

AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz