Solved

VB6 "SaveAs" not working in Win8

Posted on 2014-03-27
2
254 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
ID: 39959804
0
 

Author Closing Comment

by:NormaPosy
ID: 39968082
Thank you!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

813 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

10 Experts available now in Live!

Get 1:1 Help Now