LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default opened workbook (not resolved question)

Thanks a lot. I'm doing the checking whether the workbook
is opened. It's working good. But, if it's opened how can
I activate (open) another worksheet. (I'm doing it from MS
Access)

If logFileIsOpened = True Then '< checking working good

' < what should I do here to open another worksheet
without reopenning workbook

Else
'< It's working good
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(strFileName)
Set xlSheet = xlBook.Worksheets(strRecipeNum)
xlSheet.Activate
DoCmd.SetWarnings True
xlApp.DisplayAlerts = True
xlApp.Visible = True
xlApp.AskToUpdateLinks = True
End If

-----Original Message-----



Your button is executing

Set xlBook = xlApp.Workbooks.Open(strWorkbookName)

every time it is pressed. You need to check whether the

worbook is already open: if yes, don't open it otherwise
open it.

.

..

-----Original Message-----


If a user open a spreadsheet in a workbook pressing button
on a form with a proc like below:
........
Set xlBook = xlApp.Workbooks.Open(strWorkbookName)
Set xlSheet = xlBook.Worksheets(strWorksheetName)
xlSheet.Activate

xlApp.Visible = True
.......

The workbook with the strWorksheetName1 is still opened
(visible).

How could the user activate another strWorksheetName2
pressing the button again and without closing and
reopenning the workbook. (There are 100 sheets).

Thanks
..





 
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
open workbook b when workbook a opened [email protected] uk Excel Discussion (Misc queries) 5 July 23rd 08 01:02 AM
activate opened workbook via VBA Noemi Excel Discussion (Misc queries) 1 May 3rd 06 01:21 PM
Workbook copies itself when opened Sundevil249 Excel Worksheet Functions 4 November 30th 05 08:17 PM
I think I found a bug and need to kow how to get it resolved DMDiamond Setting up and Configuration of Excel 1 January 18th 05 12:32 AM
Is it possible to require that a KEY NUMBER be imputed in a workbook 1 before workbook 2 can be opened? Marcello do Guzman Excel Programming 0 October 15th 03 06:29 PM


All times are GMT +1. The time now is 03:10 AM.

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"