Going insane with NewWindow ignore

  • Thread starter Thread starter bigbri
  • Start date Start date
B

bigbri

:confused:

I have a locally saved copy of an Excel DB that I want to open from a
running userform. The Excel window is hidden, due to usability and
project specs. Therefore, I need to open the copy in a new Excel
window, preferably ReadOnly. The problem is that the sub is ignoring
the NewWindow command. I looked up one that I did in '97 (Using 2K
now), and the code is almost identical. It continues to open up in the
hidden Excel window, which makes it completely useless. Please Help! Am
I just overlooking syntax?

Private Sub btnShowSheet_Click()

ActiveWorkbook.FollowHyperlink "C:\SaveFiles\LOCAL_COPY.xls",
NewWindow:=True
Application.DisplayAlerts = False

End Sub
 
I was thinking about this, and here might be another way of doing this.
Is there a way that I can open the Local copy in IE? That would also
make an xlReadOnly option a moot point. I can save the local copy as an
html with no problem, unless I need to tell VBA to publish, but I don't
know how to "Open With..." in VBA
 
I'd dump the .followhyperlink and just start another copy of excel:

Option Explicit
Private Sub btnShowSheet_Click()

Dim xlApp As Application
Set xlApp = New Excel.Application

xlApp.Visible = True
xlApp.Workbooks.Open Filename:="C:\my documents\excel\book1.xls", _
ReadOnly:=True

End Sub
 
That worked like a charm. Thanks a million!

I knew it could be done, but two other programmers and myself couldn't
figure out the proc. Honestly, the new var is an ingenius solution.
Thanks again!:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top