View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Send Data From Active Sheet to Closed Sheet on Network

I just found this resource:
http://www.j-walk.com/ss/excel/tips/tip82.htm


This seems to do pretty much what I want to do, but how can I get it to
UPLOAD the data to a file saved on the network?

The code that I am working with is below:
Private Function GetValue(path, file, sheet, ref)
' Retrieves a value from a closed workbook
Dim arg As String

' Make sure the file exists
If Right(path, 1) < "\" Then path = path & "\"
If Dir(path & file) = "" Then
GetValue = "File Not Found"
Exit Function
End If

' Create the argument
arg = "'" & path & "[" & file & "]" & sheet & "'!" & _
Range(ref).Range("A1").Address(, , xlR1C1)

' Execute an XLM macro
GetValue = ExecuteExcel4Macro(arg)
End Function



Sub TestGetValue()
p = "\\fsrv3\public\Forecast\Display Forecast"
f = "Destination.xls"
s = "Sheet1"
a = "A1"
Range("A1") = GetValue(p, f, s, a)
End Sub

I thought, by simply reversing the values on either side fo te equality sigh
would work:
GetValue(p, f, s, a) = Range("A1")

Unfortunately, it doesn't work...
When I run the code like this, I get a message that says:
Run Time Error 424
Object Required

Does anyone have any thoughts on this?

Thanks,
Ryan---

--
RyGuy


"ryguy7272" wrote:

I am trying to find a way to send a range (H4:J6) of data from one
worksheet, which is saved on my desktop, but could be stored anywhere, to a
specific sheet on my firm's network (intranet). Basically, I am trying to
write to a closed workbook on a network drive. I read this resource:
http://www.erlandsendata.no/english/...=envbadacrs2ws

I guess it can be done, but I not sure how to actually implement the
procedure.

I would sincerely appreciate any help that anyone could offer.

The network UNC is:
\\fsrv3\public\Forecast



Regards,
Ryan---

--
RyGuy