Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Control box help - visual basic code

Hi, I'd like some help writing a very simple (to you all, very complex
to me) visual basic code for a control box within my excel
spreadsheet.

I use Excel 97. I know how to place a control box, recolour it etc but
its the code I'm stuck on.

I would like a user to be able to click on a control box within the
spreadsheet and then for the control box to launch an Acrobat PDF
document (or Word), but I've no idea how to write the code.

In this example the file is called "test.pdf" or "test.doc" and is
stored in "c:/excel/"

Thank you very much in anticipation of your help

Jon


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Control box help - visual basic code

Private Sub CommandButton1_Click()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\excel\test.pdf", 1
End Sub

or if you have .pdf associated with acrobat reader:

Private Sub CommandButton1_Click()
Shell "Start.exe ""c:\excel\test.pdf""""
End Sub


--
Regards,
Tom Ogilvy

"jontait " wrote in message
...
Hi, I'd like some help writing a very simple (to you all, very complex
to me) visual basic code for a control box within my excel
spreadsheet.

I use Excel 97. I know how to place a control box, recolour it etc but
its the code I'm stuck on.

I would like a user to be able to click on a control box within the
spreadsheet and then for the control box to launch an Acrobat PDF
document (or Word), but I've no idea how to write the code.

In this example the file is called "test.pdf" or "test.doc" and is
stored in "c:/excel/"

Thank you very much in anticipation of your help

Jon


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Control box help - visual basic code

Thank you so much, works a treat!

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Code hidden Dennis Excel Discussion (Misc queries) 2 October 22nd 08 07:14 AM
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
Visual Basic Code Robert Couchman Excel Programming 2 February 2nd 04 03:10 PM
Visual Basic Code in Excel Solver[_2_] Excel Programming 0 January 20th 04 07:55 PM


All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"