Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Error when VB tries to open file from Windows Explorer

I have a series of files that are maintained by several different users.
When they are finished updating, they click a button that "uploads" (copies &
pastes) their data into a master file. Here is the problem: If the user
opens their file from Windows Explorer (vs. opening from within Excel), they
get an error message when they try to perform the upload process that says
the [master file] cannot be found. On the other hand, if they open their
individual file within Excel (vs. thru Windows Explorer), they get no error
message when they perform the upload. It almost seems like I need to add
code that clearly identifies the file type as being "Excel" based?? Anyway,
here is the code that tries to open the master file:

Dim MasterFile
MasterFile = Master Tracker Q108.xls

ChDir "R:\Sales\Shared\NEW ITEM TRACKING\Q108\"
Workbooks.Open Filename:=MasterFile, WriteResPassword:="JDAY"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Error when VB tries to open file from Windows Explorer

Dim MasterFile As String

MasterFile = "R:\Sales\Shared\NEW ITEM TRACKING\Q108\Master Tracker
Q108.xls"

Workbooks.Open MasterFile, , , , , "JDAY"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Error when VB tries to open file from Windows Explorer

I tried your suggestion, but for some reason, it did not work. In fact, now
it even results in an error if you open the "user" file within
Excel---whereas before, at least that would work. Is there anything else I
can try? Perhaps something I can do with the AutoOpen procedure to ensure
that regardless of where the file is opened (Excel or Explorer) that it
"knows" the file is Excel? Thanks for your help.

"JDaywalt" wrote:

I have a series of files that are maintained by several different users.
When they are finished updating, they click a button that "uploads" (copies &
pastes) their data into a master file. Here is the problem: If the user
opens their file from Windows Explorer (vs. opening from within Excel), they
get an error message when they try to perform the upload process that says
the [master file] cannot be found. On the other hand, if they open their
individual file within Excel (vs. thru Windows Explorer), they get no error
message when they perform the upload. It almost seems like I need to add
code that clearly identifies the file type as being "Excel" based?? Anyway,
here is the code that tries to open the master file:

Dim MasterFile
MasterFile = Master Tracker Q108.xls

ChDir "R:\Sales\Shared\NEW ITEM TRACKING\Q108\"
Workbooks.Open Filename:=MasterFile, WriteResPassword:="JDAY"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Error when VB tries to open file from Windows Explorer

Considering is not valid VBA, what are you actually using ?

Dim MasterFile
MasterFile = Master Tracker Q108.xls


Maybe
Dim MasterFile As String
MasterFile = "Master Tracker Q108.xls"

Also, are you sure all users have the same drive letter in their mapping ?
And what does the ChDir achieve ?

NickHK

"JDaywalt" wrote in message
...
I have a series of files that are maintained by several different users.
When they are finished updating, they click a button that "uploads"

(copies &
pastes) their data into a master file. Here is the problem: If the user
opens their file from Windows Explorer (vs. opening from within Excel),

they
get an error message when they try to perform the upload process that says
the [master file] cannot be found. On the other hand, if they open their
individual file within Excel (vs. thru Windows Explorer), they get no

error
message when they perform the upload. It almost seems like I need to add
code that clearly identifies the file type as being "Excel" based??

Anyway,
here is the code that tries to open the master file:

Dim MasterFile
MasterFile = Master Tracker Q108.xls

ChDir "R:\Sales\Shared\NEW ITEM TRACKING\Q108\"
Workbooks.Open Filename:=MasterFile, WriteResPassword:="JDAY"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not open .xls files via Windows Explorer paulmitchell507 Excel Discussion (Misc queries) 3 October 2nd 09 01:40 PM
File Open Vs Opening from Windows Explorer [email protected] Excel Discussion (Misc queries) 0 September 7th 07 10:15 AM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Want to Open Windows Explorer With an Excel Macro johan Excel Programming 2 September 20th 05 09:55 AM
Replace Excel File Open with Windows Explorer KymY Excel Discussion (Misc queries) 2 May 2nd 05 01:05 PM


All times are GMT +1. The time now is 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"