Solved

VB6 "SaveAs" not working in Win8

Posted on 2014-03-27
2
252 Views
Last Modified: 2014-03-31
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.
0
Comment
Question by:NormaPosy
2 Comments
 
LVL 15

Accepted Solution

by:
unknown_routine earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:NormaPosy
Comment Utility
Thank you!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now