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
349 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 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

17 Experts available now in Live!

Get 1:1 Help Now