Solved

How do I open an Excel 2000 sheet in VB6 that is connected to access through a datasource?

Posted on 2004-08-19
5
348 Views
Last Modified: 2010-05-02
How do I open an Excel 2000 sheet in VB6 that is connected to access through a datasource without the datasource residing on that particular computer?I need to have this sheet open refresh all datasources and then print to several printers?  I can't get it to work unless I create datasources on each computer.  
0
Comment
Question by:sjmmajor
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:jmacmicking
ID: 11843157
Use a file datasource instead of a system or user datasource.  That way you can store the file for the datasource in a common location (a network drive for instance) and set the Excel sheet to reference it there.
0
 

Author Comment

by:sjmmajor
ID: 11845425
Does the worksheet have to reside on each computer?  I have tried to connect a worksheet on a network drive but it doesn't update when I run it unless I detach and attach the link again.  Any better ways of doing this?
0
 

Author Comment

by:sjmmajor
ID: 11845496
Also, sometimes I am getting a binding error.
0
 
LVL 5

Accepted Solution

by:
jmacmicking earned 125 total points
ID: 11852651
The worksheet should be able to reside on a network drive with no trouble.  If you're not %100 sure everyone will have the same drive mapped to the same drive letter make sure you use the UNC path (\\servername\sharename\path).
If you can include the binding error it may help.  A few other tips;  change the Refresh control to disable background refresh (that way you don't get stall data while the refresh is occuring) and to refresh the data on file open.  To do this in Excel 2000 follow these steps:
  Open the workbook in Excel.
  Select one of the cells in the data range
  Open the Data menu
  Highlight Import External Data
  Click Data Range Properties (if this is greyed out make sure you've selected a cell in the data range)
  Turn off Enable background refresh
  Turn on Refresh data on file open
 
If you need help using the Excel object model to open and print the database let me know; I can post pseudo-code to get you started.
0
 

Author Comment

by:sjmmajor
ID: 11897466
Thanks.  I changed the datasources to file datasources on the server and used the UNC path as well as refresh the data.  It works!!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now