-
Mar 23rd, 2011, 06:45 AM
#1
Thread Starter
New Member
Automation error - Please Help :)
Dear all,
I have created 2 excel workbooks to play the role of a Communication Log System in our school. Just put it on the server, activate sharing property, and u'll have a communication system much faster than emails, and more practical.
The first file is where people insert there messages using a UserForm and is called "Log".
The other one is called "Inbox". Using some excel functions, the Inbox file generates 3 lists:
1- A To-Do list: a list of all messages that where sent to u.
2- A Follow-Up list: a list of all messages that you sent.
3- Announcements list: a list of all messages that where marked as general announcement.
The 2 files are connected through VBA. The whole thing was supposed to be simple, and one interested in using it in his/her company, then u are more than welcome to download it using this link:
http://www.evision-me.com/hariri/gli...cation_Log.rar
There is one problem, the files worked fine for 1 time, then it started giving me this error:
"Automation error The object invoked has disconnected from its clients"
The problem is in the code, and the error message is appearing even before sharing the file.
I'm really still a beginner at VBA and i couldn't understand the solutions that are posted in this forum or in other forums. Any help will be highly appreciated
Regards
Sadek
-
Mar 23rd, 2011, 07:30 AM
#2
Re: Automation error - Please Help :)
Welcome to VB Forums!!!
To fix the error you need to find the line in the code that is causing the error. Step through the code and check values to see if they are what you expect.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Mar 23rd, 2011, 08:39 AM
#3
Thread Starter
New Member
Re: Automation error - Please Help :)
Dear MarMan
I tried stepping in the code, i'm using a text boxes to insert a username and password, i called them:
TextBoxUserName
TextBoxPassword
I placed a CommandButton and Called it:
CBLogIn
Once i press CBLogIn, the number in TextBoxUserName should go to cell E1 and number in TextBoxPassword should go to E2. It is supposed to be simple:
Range("E1").Value = TextBoxUserName.Value
Range("E2").Value = TextBoxPassword.Value
Once the debuger reaches these lines, the program hangs.
I tried selecting the cells first:
Range("E1").Select
ActiveCell.Value = TextBoxUserName.Value
and through a variable:
Dim UserName as Long
UserName = TextBoxUserName.Value
Range("E1").Value = UserName
No matter what i try, every time i reach this command, i get:
"Automation error The object invoked has disconnected from its clients"
Any suggestions?!
Thanks big time mate!!
Regards
Sadek
-
Mar 23rd, 2011, 11:26 PM
#4
Thread Starter
New Member
Re: Automation error - Please Help :)
-
Mar 24th, 2011, 06:18 AM
#5
Hyperactive Member
Re: Automation error - Please Help :)
Did you try to do something like
VB Code:
Sheets("yoursheetname").Range("E1").Value = UserName or Activesheet.Range("E1").Value = UserName
?
I can't see in the above code the sheet object , try to declare the sheet or workbook object ...
This may be coming from this ..
Otherwise, Sometimes formulas can cause such errors, so try at the beginning of the macro to disactivate them then reactivate them ...
For expl your macro is running to change the values while the execl is try automatically to recalculate them, so that it can cause the error you mentionned ...
Try this :
VB Code:
Application.Calculation = xlCalculationManual
'Your Code here
'End of your Code
Application.Calculation = xlCalculationAutomatic
Also check this , it may help ?
-
Mar 24th, 2011, 07:41 AM
#6
Thread Starter
New Member
Re: Automation error - Please Help :)
justgreat you are the best... the automatic calculation was the problem, once I stopped it the file worked well...
You are the best... I'll post back the files for everyone to check them and use them
Regards
Sadek
-
Mar 24th, 2011, 08:29 AM
#7
Hyperactive Member
Re: Automation error - Please Help :)
Thanks Sadek, please Tag the Thread as Resolved once you post the file for others to check
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|