PC Review


Reply
Thread Tools Rate Thread

Creating a hyperlink in VBA for an autoshape

 
 
Jim
Guest
Posts: n/a
 
      8th Jul 2008
ok, so i have created an autoshape on a spreadsheet, I have created a macro
for it and need it to link to a file in another directory. the reason i am
not just creating a "right click-->create hyperlink" is because it is getting
screwed up when i run the main program. I want to know how to write it in VB
so it automatically creates the hyperlink thru the macro.

Sub Rectangle5_Click( )
make hyperlink to c:\myfile.doc
End Sub

thanks
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      8th Jul 2008
You want to create a hyperlink or do you want to perform the action a
hyperlink would perform?

--
Regards,
Tom Ogilvy


"Jim" wrote:

> ok, so i have created an autoshape on a spreadsheet, I have created a macro
> for it and need it to link to a file in another directory. the reason i am
> not just creating a "right click-->create hyperlink" is because it is getting
> screwed up when i run the main program. I want to know how to write it in VB
> so it automatically creates the hyperlink thru the macro.
>
> Sub Rectangle5_Click( )
> make hyperlink to c:\myfile.doc
> End Sub
>
> thanks

 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      8th Jul 2008
I want the file to open when I click on the shape and I want to do it thru a
macro. so I guess to answer your question, perform the action that a
hyperlink would.

"Tom Ogilvy" wrote:

> You want to create a hyperlink or do you want to perform the action a
> hyperlink would perform?
>
> --
> Regards,
> Tom Ogilvy
>
>
> "Jim" wrote:
>
> > ok, so i have created an autoshape on a spreadsheet, I have created a macro
> > for it and need it to link to a file in another directory. the reason i am
> > not just creating a "right click-->create hyperlink" is because it is getting
> > screwed up when i run the main program. I want to know how to write it in VB
> > so it automatically creates the hyperlink thru the macro.
> >
> > Sub Rectangle5_Click( )
> > make hyperlink to c:\myfile.doc
> > End Sub
> >
> > thanks

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      8th Jul 2008
Executing this statement should open up your file using the associated
program for its extension (in the case of your original posting, Word should
open up and your myfile.doc document should be loaded automatically)...

Shell Environ("COMSPEC") & " /c ""c:\myfile.doc""", vbHide

Make sure you preserve the spacing and quote marks as shown when
substituting your actual file name in for the sample myfile.doc one.

Rick


"Jim" <(E-Mail Removed)> wrote in message
news7BDFAE6-B465-46CF-9B27-(E-Mail Removed)...
>I want the file to open when I click on the shape and I want to do it thru
>a
> macro. so I guess to answer your question, perform the action that a
> hyperlink would.
>
> "Tom Ogilvy" wrote:
>
>> You want to create a hyperlink or do you want to perform the action a
>> hyperlink would perform?
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>> "Jim" wrote:
>>
>> > ok, so i have created an autoshape on a spreadsheet, I have created a
>> > macro
>> > for it and need it to link to a file in another directory. the reason i
>> > am
>> > not just creating a "right click-->create hyperlink" is because it is
>> > getting
>> > screwed up when i run the main program. I want to know how to write it
>> > in VB
>> > so it automatically creates the hyperlink thru the macro.
>> >
>> > Sub Rectangle5_Click( )
>> > make hyperlink to c:\myfile.doc
>> > End Sub
>> >
>> > thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Autoshape box pops up on screen when autoshape is selected MaddyP Microsoft Powerpoint 0 28th Oct 2009 05:12 PM
Update Autoshape's Hyperlink Max Microsoft Excel Programming 2 14th Oct 2009 02:14 AM
Draw/Change Autoshape to custom autoshape for a comment Matthew Schwarz Microsoft Excel Discussion 0 11th Oct 2009 06:17 AM
Hyperlink in AutoShape =?Utf-8?B?R2Vja28=?= Microsoft Excel Misc 5 17th Mar 2006 01:28 PM
Dynamic web template, Autoshape textbox, hyperlink corrupting =?Utf-8?B?Tmlja3Bhcms=?= Microsoft Frontpage 2 3rd Feb 2005 04:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 PM.