w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Opening a file with full network name changes sheet names

I'm not able to recreate this issue but its possible the below alternative method to open a workbook may be of some help.

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub OpenTest()
Dim objXL As Object
Dim oShell As Object
Dim strExcel As String
Dim WBPath As String

strExcel = Chr(34) & "C:Program FilesMicrosoft OfficeOffice12EXCEL.EXE"
& Chr(34) & " /e "

WBPath = "\*full network name*METrends.xlsm"

Set oShell = CreateObject("WScript.Shell")
Set objXL = Nothing
oShell.Exec (strExcel & Chr(34) & WBPath & Chr(34))
Sleep 2000
Set objXL = GetObject(WBPath).Application
objXL.Application.Goto objXL.Sheets(1).Range("A1"), True
Set objXL = Nothing
End Sub

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.