Hi all
I have built a Input form using the VBA Editor to collect information from users and input it into a work sheet. The form works well when opened from Excel, data can be input and all the programme funtions work well.
However, because the form is to be used by many users across the company, a link to the form has been added to the company intranet for every one to use. The form opens, prompts to allow the use of macros and then opens within Interntet Explorer, in other works in Excel inside IE. After being opened this way the form no longer works. A button called Save should take the data from the form and input it to the sheet but I get "Run time error 91, Object Variable or With Block Variable not set". I cannot figure out why this happens and can only think it has something to do with the spread sheet opening inside IE. Some of the code is below, any help would be appreciated.
The error is on the 'ActiveWorkBook.Sheets("fromform").Activate' line.
Sub Save()
Dim varcount As Integer
Dim strINCR As String
Dim strCity, strNum, strShift As String
Dim todaysDate As Date
'On Error GoTo errorAction
'Assign values to variables
strCity = "AKL"
varcount = 0
todaysDate = Date
'Open data collection sheet
ActiveWorkbook.Sheets("fromForm").Activate
'Select first cell in column in active worksheet to enter data into
Range("A53").Select
'Loop to find first empty cell
Do
If IsEmpty(ActiveCell) = False Then
'Select next cell down
ActiveCell.Offset(1, 0).Select
varcount = varcount + 1
End If
Loop Until IsEmpty(ActiveCell) = True
'Create INCR Number
strNum = str(varcount)
strINCR = strCity + strNum
'MsgBox strINCR
Rows("53:53").Select
Selection.Insert Shift:=xlDown
Range("A53").Select
Thanks and regards
Craig
Bookmarks