Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2007, 03:00 PM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 1004 - Cannot Access file "bla-bla-bla"

I am not new to VB, yet this error is new to me.
I'm running an application that has run for years with no problem. Suddenly, the users are experiencing an error 1004 when this application attempts to open up an EXCEL file, and write to it. Can't figure it out. The file is there, spelled correctly etc..yet the VB AP just can't seem to find it. I even tried to open up a dialogue box, and have the user select that file specifically. When they select that particular file that they want to write to....SAME RESULT. 1004, can't access it.
Is anyone familiar with this error. I'm running VB 6, and EXCEL 2002.

 
Old April 3rd, 2007, 12:13 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Sure sounds like a security change has removed the user your app is impersonating from that file’s Access Control List.

A group has been removed, its properties have been changed, the file’s list of those who can read it has changed, or the app is now being run under the auspices of a different username.
 
Old April 3rd, 2007, 12:48 PM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx Brian.
The common denominator thru all of this is the fact that the clients getting this "1004 Cannot access the file error", have all recently gone thru new PC lease/roll machines. For some reason, the way the new machines are now imaged (XP) leaves them with this message. To install all of the necessary DLLs etc.., I created a setup package with the deployment wizard that has always worked and done the trick. Now with these new machines, they are getting the 1004 message. I have an additional stand alone machine that has VB 6 loaded on it, and I don't get this error. This App is simply a report generator which writes data from an ACCESS db to many, many EXCEL workbooks. None of them are now accessible for these clients thru this App ????

 
Old April 3rd, 2007, 05:15 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The VB 6 IDE runs with different permissions than an application built from it. Could still be it.

Check the Security log with EventViewer to see if there are any messages that shed light on this.




Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP?something=bla TheSchwa Beginning PHP 2 October 5th, 2007 08:24 AM
Run time error 1004 Ken Matthews Excel VBA 1 March 2nd, 2007 06:30 AM
Run-time error '1004': raja.gogoi VB Components 1 July 18th, 2004 11:02 AM
PublishObjects give Error 1004 TimP Excel VBA 1 June 16th, 2004 03:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.