View Single Post
 
Old 08-24-2018, 11:52 AM
shaztastic shaztastic is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Aug 2018
Location: Wales, UK
Posts: 10
shaztastic is on a distinguished road
Default Using Content Control Checkboxes to open associated excel files

Hi

I'm really struggling with this, code is not my thing any help or pointers really appreciated

I have a word 2010 document. I have a list of documents each with an associated checkbox. If a checkbox is checked I want to open the associated document, which is an excel file, when I click on a command button.

So i have an Active X checkbox with this code which opens the excel file as soon as i check it which is not quite what i want to do but i seem to keep going in circles (if possible i would like to use ContentControl Checkboxes but i cant even get the code I've got to work with them)......

Code:
 
Private Sub CheckBox1_Click()
 Dim oExcel As Excel.Application
    Dim oWB As Workbook
     Set oExcel = New Excel.Application
     Set oWB = oExcel.Workbooks.Open("C:\Temp\MyDoc.xls")
     oExcel.Visible = True
End Sub
Reply With Quote