If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Link 2 worksheets - w/auto update

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-05, 10:09
siso0006 siso0006 is offline
Registered User
 
Join Date: Mar 2005
Posts: 3
Link 2 worksheets - w/auto update

I need help, please!

I need to link two worksheets together, the sheets are located in different workbooks. One sheet contains formulas and is linked to a SQL database that gives current value. I need to copy this sheet into another workbook and have it update automatically - like every night.

I have no idea where to start. Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 03-10-05, 10:19
Belgrad Belgrad is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
Auto-update may be done with an external script. You write a script in VB, create a scheduler task that runs this script with windows scripting host every night.
Reply With Quote
  #3 (permalink)  
Old 03-10-05, 10:32
siso0006 siso0006 is offline
Registered User
 
Join Date: Mar 2005
Posts: 3
Huh? Are there any resources I can use, or look up? I have very limited programming knowledge

Or any specific directions you can give me? Thanks so much!
Reply With Quote
  #4 (permalink)  
Old 03-10-05, 10:57
Belgrad Belgrad is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
First of all you need to record a macro that does all necessary operations with these two workbooks. Then create a file with .vbs extention and write something like this:

Set appExcel = CreateObject("Excel.Application")

' here goes your just recorded macro. appExcel variable is exactly the same
' as Application object in Excel VBA. E.g. appExcel.ActiveWorkbook gives you
' the active workbook



This something.vbs script file has to be run via Windows Scripting Host as follows:

cscript something.vbs
Reply With Quote
  #5 (permalink)  
Old 03-10-05, 11:08
siso0006 siso0006 is offline
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks! I think I got the logic behind it down.

1.) Macro that does all necessary operations between the 2 sheets.
2.) .VBS extension file
3.) VBS Script file

Do you know where I can find books on how to work this out? The thing is, I started working for a company that doesn't have an IT dept. I don't have any programming knowledge and am basically starting from scratch. Thanks again.
Reply With Quote
  #6 (permalink)  
Old 03-10-05, 11:27
Belgrad Belgrad is offline
Registered User
 
Join Date: Mar 2005
Posts: 8
Mmm... There are three things I use:

1. Microsoft Excel help
2. Windows Scripting Host reference downloadable from download.microsoft.com (it also contains complete jscript and vbscript reference)
3. Google ))

There is no better way to start learning VBA than to record a macro and dig it with a help opened in a second window For a programming related information try www.codeproject.com. There are plenty of examples and "getting started" manuals there.

As for this task with external processing of excel workbooks the main idea is that excel application can be run invisibly and quietly as an ActiveX object almost from anywhere.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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