Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Process won't run second time in ACCESS 2003

Posted on 2013-06-06
4
Medium Priority
?
498 Views
Last Modified: 2013-06-07
I have a form in an ACCESS 2003 database from which the user can select days to create am Excel 2010 workbook.  They can select, say, all the Month of May, run the process to export the data to Excel.  However, if they select another month, say March, then run it again, the process fails.  It throws Error Number 91, Object variable or With blcok variable not set.  This is a show stopper and I have no idea what to look for.

Sandra
0
Comment
Question by:ssmith94015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 400 total points
ID: 39227534
How are you creating the Excel Workbook?

It would help to see the VBA you are using.

If you are using Automation you might have an issue with Excel not getting terminated properly.
0
 
LVL 22

Assisted Solution

by:Kelvin Sparks
Kelvin Sparks earned 400 total points
ID: 39227546
Also check what object you shut at the end that may have been opened prior to the first session. Probably identified by .Quit

Kelvin
0
 
LVL 20

Accepted Solution

by:
clarkscott earned 1200 total points
ID: 39229802
"Object variable or With blcok variable not set" means you are trying to access an object that is "no longer there".  You may want to close your Excel app completely when finished, then run he whole thing again when you want to do another.
Put all you Excel code (dims, open, close, etc.) in a function and pass the necessary info to the function each time.
Scott C
0
 

Author Closing Comment

by:ssmith94015
ID: 39230613
Yes, that was it.  All suggestions contributed to the solution.  Thank you as this was a real problem.

Sandra
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question