Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Update workbook without opening it?

I am trying to find a way to copy a range to a closed workbook. Right now,
the workbook is opened and the update is subsequently made.

My code to update the workbook is below:
Private Sub CommandButton1_Click()
Cells(12, 9) = TextBox1.Text
Cells(12, 10) = TextBox2.Text
Cells(12, 11) = TextBox3.Text

Cells(13, 9) = TextBox4.Text
Cells(13, 10) = TextBox5.Text
Cells(13, 11) = TextBox6.Text

Cells(14, 9) = TextBox7.Text
Cells(14, 10) = TextBox8.Text
Cells(14, 11) = TextBox9.Text

'Sub SaveValuesToNetworkFile()
Dim p As String
Dim f As String
Dim s As String
Dim r As String
Dim ws As Worksheet

p = "\\fsrv3\luna\public\Sales Operations\Ryan\"
f = "Destination.xls"
s = "Sheet1"
r = "I12:K14"
Set ws = ActiveSheet
Workbooks.Open (p & f)

' copy range values from current worksheet to same range in network file
ws.Range(r).Copy Workbooks(f).Worksheets(s).Range(r)
' close network file, saving changes
Workbooks(f).Close True

UserForm1.Hide

End Sub


Everything works fine, but the file has to be opened from the LAN, and the
file is getting kind of large now, so it takes a while to open, make the
update, and then close. I was hoping to find a way to simply updating the
workbook, without actually opening the workbook. I believe this method will
be extremely quick€¦if I can just get it working€¦

Id appreciate any and all help on this topic.


Regards,
Ryan---



--
RyGuy
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
Update workbook links without opening all workbooks Steve Vincent Excel Discussion (Misc queries) 1 January 6th 09 11:14 PM
how can update the data in an excel workbook without opening it dk Excel Worksheet Functions 0 April 14th 06 02:28 PM
Hide prompt to automatically update links on workbook opening DannySS Excel Programming 1 June 10th 04 02:25 PM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM


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