Link to home
Start Free TrialLog in
Avatar of Norma Posy
Norma PosyFlag for United States of America

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".

Set oXLApp = CreateObject("Excel.Application")
If oXLApp.Application.Version > "11.0" Then
    iXLVersion = 56
Else
    iXLVersion = -4143
End If
Set oXLApp = Nothing

Open in new window


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

Open in new window


Problem: When this program is run on Windows 8, user reports that the generated spreadsheet is not saved.
ASKER CERTIFIED SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Norma Posy

ASKER

Thank you!