LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Problems with file to be used on different systems.

Hi All,

I am trying to produce a spreadsheet that will be accessed by remote users,
save itself under a individual's name and then when the remote file is opened
again it searches the individual's computer for a that file, if it is there
then it is opened and the original file is opened and the user continues to
work on it, blissfully unaware that anything has happened. When the user has
finished making all their changes they then email the sheet back to me via a
send button.

Now...I have this working perfectly on my computer but the users computers
are less straightforward. I have a facility to test it on identical sytems
as those that will be used, some of which are NT, some XP and they have
thrown up some problems which I will outline below (This should possibly be
split into more than one post?)

1. Searching for files:

I have used the following code:

Private Sub Search_Saved_Proforma()
Dim Store As String
Dim wkbk As Workbook

Let User = Range("User_Name")
Let Template_File = "Example Template File"

With Application.FileSearch
.NewSearch
'.LookIn = "C:\temp\practice\new practice\"
.SearchSubFolders = False
.Filename = User & ".xls"
' .FileType = msoFileTypeAllFiles
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
Set wkbk = Workbooks.Open(.FoundFiles(i))

Workbooks(Template_File & ".xls").Close savechanges:=False

wkbk.Activate

Next i

Else

End If

End With

Template file is the file that the users will open while user is the file
that is saved on their computer. This works fine on NT and my computer which
is XP, but the for users computers with XP this doesn't work, producing a run
time error 1004 (Method File Search of Object).

2.Running a Workbook_Open Event (Not sure if I worded that properly.

I have a macro that runs when the workbook opens. Private Sub
Workbook_Open()

This activates the front sheet, and then brings up userforms to determine
who the user is and then runs the search. In XP, this is fine (except for
the search problem as detailed above). In NT however, the userforms come up
before the sheet has appeared and then the search part of the routine doesn't
run/doesn't appear to run. Any ideas? Code is below.

Private Sub Workbook_Open()

Sheet3.Activate

If Range("User_Name") = "" Then
'If Range("User_Name") = 0 Then

'''If the sheet name is blank ie. if the template has been opened for the
first time
'''then choose a user from userform

Range("STRNUMrange").Value = Environ("STRNUM") 'nb. strnum is an equivalent
of "username"
Confirm_user.show 'confirm that this is the correct user


If Range("user_Name") = "" Then
'If Range("user_Name") = 0 Then

'''If the person cancels out of the select user dialogue then
'''the book will close

MsgBox "value equals 0 or "", would now shut sheet"

'Workbooks("Peak 2007 Pro Forma Practice.xls").Close
savechanges:=False


Else

'''Search for sheets already saved on the c:\ drive providing that
'''a store has been selected
Application.ScreenUpdating = False

Search_Saved_Proforma 'searches for files with the user name on
the user computer

Application.ScreenUpdating = True

Show_Scope_Details 'ignore

End If

Else

'''If user name doesn't equal 0 as in the case of a form that has already been
'''filled in to some extent, then just continue filling it in. This will only
'''apply if the form has been opened from within the search saved proforma vb.

Let user_scope = Range("Scope").Value

End If

End Sub


Sorry for the excessively long message, just need a bit of help finishing
this off and would appreciate any help.

 
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
How can I access a SAS systems file and save it in Excel pmw101 Excel Discussion (Misc queries) 2 March 3rd 05 03:03 AM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM
File systems nath Excel Programming 2 July 6th 04 01:27 PM
Any Systems Analysts here? Souljah[_4_] Excel Programming 3 May 24th 04 12:32 AM
Distributing a VBA app across different systems, help please Joe 90[_2_] Excel Programming 0 November 14th 03 05:20 PM


All times are GMT +1. The time now is 02:21 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"