#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Saving Data

Then you would need to treat the closed workbook as a database and update it
using ADO

Mr. Erlandson has some information on ADO and excel although I believe it is
more focused on reading than writing:

DAO/ADO
http://www.erlandsendata.no/english/...php?t=envbadac


--
Regards,
Tom Ogilvy




"DarnTootn" wrote:

sorry, my explanation was not that good.. here is the situation... When an
employee inputs data in a userform the data is saved to two different
worksheets within the the workbook. everything works perfectly. Now the
boss wants the second worksheet information saved not into the same workbook
but into a closed workbook. is there a code to save this information to the
closed workbook called "ProjectStats".. currently that sheet is in the
workbook with the userform that is open. the ProjectStats workbook is not
open and only accessible to myself and a handful of admin folks... we do not
want the reg. employees to have to open the second workbook to save that
information to this second workbook.... Does that explain it a little
better... here is an example of the code I am currently using to send the
information to the proper worksheet within the open workbook..

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Dim ws1 As Worksheet
Set ws1 = Worksheets("ProjectData")
Set ws = Worksheets("Billing Sheet")

'find first empty row in database
iRow = ws1.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'copy data to database
With ws1
.Cells(iRow, 1).Value = Me.txtProjectName.Value
.Cells(iRow, 2).Value = Me.txtStartDate.Value
.Cells(iRow, 3).Value = Me.txtEndDate.Value.....(a total of 16 lines of
code here continues... then....

'copy data to database
With ws
.Cells(12, 1).Value = Me.txtCoopName.Value
.Cells(12, 4).Value = Me.txtProjectName.Value
.Cells(12, 7).Value = Me.cboCrewName.Value...(more cells after this too)

So you can see I have two worksheets within the workbook ws and ws1. ws1 is
the info I need to go to the closed workbook.. thanks for your help... you
have helped me in the past... your info is great

"Tom Ogilvy" wrote:

What does saving userforms/workbooks to another workbook even mean, much less
a closed workbook?

You can export a useform, open another workbook and import it.

You can copy worksheets from one open workbook to another.

This can be done in code. Sure it wouldn't just be easier to have your
code open the workbook and make the additions, then save it and close it.

--
Regards,
Tom Ogilvy

"DarnTootn" wrote:

I have a couple of userforms/workbooks that I need to save to a closed
workbook... How can this be accomplished... I have searched but to no
avail.... PLZ HELP...

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
Saving data Sidney Excel Discussion (Misc queries) 0 February 25th 10 02:10 PM
saving data? Rhea Excel Discussion (Misc queries) 3 July 22nd 09 02:36 PM
Saving data bach Excel Programming 3 October 7th 05 01:31 PM
Saving worksheet as CSV after pulling data from an external data source Richard Edwards[_3_] Excel Programming 4 February 25th 05 09:08 PM
Saving Data ceplane[_3_] Excel Programming 5 May 11th 04 02:27 PM


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