Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Script for Excel Revised Question
I need to activate a workbook through a cell reference. the workook
name is stored in cell A1 as "pnlreport_060321.xls". This name automatically changes daily based on the date. This is how I wrote the code to activate the workbook: Sub import() Dim fileA As String fileA = Range("A1").Value windows("fileA").Activate End Sub However this does not seem to work. It gives me an error message "Run-Time Error '9': Subscript Out of Range" and stops at the third line (windows("fileA").Activate). Please HELP. How would I activate a workbook which is already open. I cannot use the file name in the code because the name changes every day. Thanks : ) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Script for Excel Revised Question
Try Code ------------------- windows(fileA).Activate ------------------- -- Ivan F Moal ----------------------------------------------------------------------- Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195 View this thread: http://www.excelforum.com/showthread.php?threadid=52512 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Script for Excel Revised Question
It doesn't work Ivan. It still gives me same error and brings the
yellow mark on that same line. thnx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Script for Excel Revised Question
Is cell A1 = "pnlreport_060321.xls" the same as your Window activat name? It may read "pnlreport_060321" depending on weeather your window setting is set to display File extensions -- Ivan F Moal ----------------------------------------------------------------------- Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195 View this thread: http://www.excelforum.com/showthread.php?threadid=52512 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Revised formula question | Excel Discussion (Misc queries) | |||
Format excel to revised date automatically when revised | Excel Programming | |||
IF Function with Date revised question | Excel Worksheet Functions | |||
excel script question -- numbers to words | Excel Programming | |||
Revised Question on Page Numbering | Excel Programming |