Norma Posy
asked on
VB6 "SaveAs" not working in Win8
VB6 program developed under XP.
Program installed on Windows 8 machine.
Program constructs an Excel spreadsheet, and saves it.
When program first loads, one bookkeeping chore is to determine the Excel version resident. The following code lines determine the value of variable "iXLVersion", which is used for "FileFormat" in the "SaveAs".
The following code generates the spreadsheet and saves it:
Problem: When this program is run on Windows 8, user reports that the generated spreadsheet is not saved.
Program installed on Windows 8 machine.
Program constructs an Excel spreadsheet, and saves it.
When program first loads, one bookkeeping chore is to determine the Excel version resident. The following code lines determine the value of variable "iXLVersion", which is used for "FileFormat" in the "SaveAs".
Set oXLApp = CreateObject("Excel.Application")
If oXLApp.Application.Version > "11.0" Then
iXLVersion = 56
Else
iXLVersion = -4143
End If
Set oXLApp = Nothing
The following code generates the spreadsheet and saves it:
Set oXLApp = CreateObject("Excel.Application")
Set oXLBook = oXLApp.Workbooks.Add
Set oXLSheet = oXLBook.Worksheets(1)
sWorkbookName = "DataPlayers.sdp"
With oXLApp
'
' Code here loads up the spreadsheet
'
End With
oXLBook.SaveAs App.Path & "\" & sWorkbookName, FileFormat:=iXLVersion
oXLApp.Quit
Set oXLApp = Nothing
Set oXLBook = Nothing
Set oXLSheet = Nothing
Problem: When this program is run on Windows 8, user reports that the generated spreadsheet is not saved.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER