Re: Open multiple excel spreadsheet from ppt VBA

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On May 8, 3:44 pm, Lily <L...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I used

set wksheet1=XLApplication.workbooks.open(excel filename as
string).worksheet("ws1")

and it did work.

But I don't know how to open another worksheet from the same excel file.

thanks,

Here this worked for me ...

with createobject("excel.application")
set oWB1 = .workbooks.open(sXLfilename)'
oWB1.worksheets(1).activate
.visible = true
end with

msgbox "pause"

with createobject("excel.application")
set oWB2 = .workbooks.open(sXLfilename)'
oWB2.worksheets(2).activate
.visible = true
end with

Entirely different instatiations of the Excel.Application object are
needed to get simultaneous displays of different sheets in a
workbook. Only the first one you open will be editable. Later
versions are opened Read-only. Also, they will appear one over the
other (the second will hide the first, until it is moved, etc.). I
didn't take the time to figure out how to move them about.

HTH,

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.



Relevant Pages

  • Re: Forcing a Read Only Filename
    ... with the filename being a specific cell or named range. ... 'This is workbook event code. ... right click on the Excel icon on the worksheet ...
    (microsoft.public.excel.misc)
  • RE: Copy worksheets and save files dynamically
    ... incremental filename to the previous? ... What I was hoping for was to take the number element of the worksheet name - ... Dim wb As Workbook, ws As Worksheet, wbNew As Workbook ... I've been trying to write a macro to copy each worksheet within a workbook ...
    (microsoft.public.excel.misc)
  • Re: multiple worksheets in a workbook, each saved on its own.
    ... In my master workbook, this contains a link to another Excel file ie ... Sale_Feb05, When I copy the worksheet, it copies the external links also. ... > Dim WbMain As Workbook ...
    (microsoft.public.excel.programming)
  • Re: Hyperlink to a specific worksheet in another workbook
    ... Private Sub Worksheet_BeforeDoubleClick(ByVal _ ... Edit the path and filename to suit. ... another workbook. ... I would like to click on each cell and be taken to a corresponding worksheet ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Disabling Min and Max buttons in Excel Worksheet
    ... Tools>Protection.....Protect workbook (Select Windows) ... > I recently recieved an Excel file from someone where the Min, Max & Close> buttons of the Excel Worksheet are disabled. ...
    (microsoft.public.excel.programming)