Hi,
I'm currently working on an VBA project which has to enable someone to connect to a database via Excel. Validate his data and delete.
The coding worked fine when placed in a module.
Now I want to have this coding in an Add-in , so when I have some new functions/modifications I don't have to adjust all the excel files.
My problem now is , when I call a function in the XLA which has to perform some sheet modifications , the XLA doesn't seem to find my sheets?
example
(XLA extract)
Function AskID()
Dim WB As Workbook
Set WB = ActiveWorkbook
'HFE_Excel being a sheet on my book1.xls
WB.Sheets("HFE_Excel").Select <-- here I get an error Out of Range
UserForm1.Show ' opens a loginform
End Function
(book1.XLS.ThisWorkbook)
Private Sub workbook_open()
run "AskID"
End Sub
Someone ?
I've been searching on the Net for 2days now, without success
I'm currently working on an VBA project which has to enable someone to connect to a database via Excel. Validate his data and delete.
The coding worked fine when placed in a module.
Now I want to have this coding in an Add-in , so when I have some new functions/modifications I don't have to adjust all the excel files.
My problem now is , when I call a function in the XLA which has to perform some sheet modifications , the XLA doesn't seem to find my sheets?
example
(XLA extract)
Function AskID()
Dim WB As Workbook
Set WB = ActiveWorkbook
'HFE_Excel being a sheet on my book1.xls
WB.Sheets("HFE_Excel").Select <-- here I get an error Out of Range
UserForm1.Show ' opens a loginform
End Function
(book1.XLS.ThisWorkbook)
Private Sub workbook_open()
run "AskID"
End Sub
Someone ?
I've been searching on the Net for 2days now, without success