LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JP JP is offline
external usenet poster
 
Posts: 103
Default How to test if an Excel spreadsheet exists in VBScript?

I'm trying to reference an Excel spreadsheet that may not exist at the time
of the test, like this:
xlApp.WorkSheets("Test").Select
I would like to test if the "Test" sheet exist before selecting it. How to
do it in VBScript? I tried this:
IsObject(xlApp.WorkSheets("Test")), but it only worked if "Test" existed, it
gave me an error when it didn't.
Thanks a bunch,
JP
 
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
Test if file exists Daniel Bonallack Excel Discussion (Misc queries) 2 May 4th 09 04:19 PM
Test for Worksheet Exists bcmiller[_8_] Excel Programming 4 July 2nd 04 11:46 AM
Opening excel spreadsheet from within a VBscript Disco[_2_] Excel Programming 7 January 23rd 04 03:50 PM
Test if a folder exists Jeff Marshall Excel Programming 6 September 30th 03 05:21 PM
VBScript Automation of Excel Spreadsheet Sorting & Filtering Tom Ogilvy Excel Programming 1 September 10th 03 03:01 PM


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