JonRowland
Active Member
- Joined
- May 9, 2003
- Messages
- 417
- Office Version
- 365
- Platform
- Windows
Hi Guys,
I have an Add-In and various procedures look up various directories to pull data and other stuff.
Whilst this works fine, if I move my Add-In to another network with different Drive names then I have to go and amend the code to fit with the new Drive conventions. Fine if it is me but if I give it to let's say non-techs then I'd have to give then passwords to unlock the code and tell them what to change etc etc. Too much risk as they may screw the code up.
So I had a bright idea and why not allow User to run a procedure which present them with a Form to fill and then save that data into the Worksheet 1 of the Add-In and update my code to use the info stored in that WkSht.
So I have the form but can't work out how to write to the Add-In Worksheet.
So I thought I would be able to use this code within the Form but it fails on the ActiveWorkBook part.
Any help or suggestions would be most welcome.
I have an Add-In and various procedures look up various directories to pull data and other stuff.
Whilst this works fine, if I move my Add-In to another network with different Drive names then I have to go and amend the code to fit with the new Drive conventions. Fine if it is me but if I give it to let's say non-techs then I'd have to give then passwords to unlock the code and tell them what to change etc etc. Too much risk as they may screw the code up.
So I had a bright idea and why not allow User to run a procedure which present them with a Form to fill and then save that data into the Worksheet 1 of the Add-In and update my code to use the info stored in that WkSht.
So I have the form but can't work out how to write to the Add-In Worksheet.
So I thought I would be able to use this code within the Form but it fails on the ActiveWorkBook part.
Any help or suggestions would be most welcome.
Code:
Public gblSourceDrive as string
Public gblProcessFolder as string
Private Sub OKButton_Click()
' Set Variable Values from Form Data
gblSourceDrive = txtSourceDrive
gblProcessFolder = txtProcessFolder
' Transfer information into WkSht(1) of Add-In
ActiveWorkbook("MyAddIn.xlam").Sheets(1).Cells(2, 2) = gblSourceDrive
ActiveWorkbook("MyAddIn.xlam").Sheets(1).Cells(3, 2) = gblProcessFolder
' To add code to Save
End Sub
Last edited by a moderator: