zombiemaster
Board Regular
- Joined
- Oct 27, 2009
- Messages
- 245
Hoping someone can help. I'm testing some macros for our upcoming upgrade from WIN10 32-bit to WIN11 64-bit and have run into an issue with one of them.
This macro scrapes user-input data from one spreadsheet tab and pastes it into another tab with more formal formatting, then that formatted tab gets saved as a PDF to a location of the user's choice. The file name for the PDF is defaulted to a combination of the name and policy number in cells B17 and B7.
This has been working for years with no issues, but when I am running it in the WIN11 testing virtual machine, the PDF that gets saved is corrupted and won't open.
The code below is the section where it saves the file - does anyone see something that might be an issue? I would have thought that doing a "save as" would be pretty generic from WIN10 to WIN11...
Thanks for any help as always,
-=ZM=-
This macro scrapes user-input data from one spreadsheet tab and pastes it into another tab with more formal formatting, then that formatted tab gets saved as a PDF to a location of the user's choice. The file name for the PDF is defaulted to a combination of the name and policy number in cells B17 and B7.
This has been working for years with no issues, but when I am running it in the WIN11 testing virtual machine, the PDF that gets saved is corrupted and won't open.
The code below is the section where it saves the file - does anyone see something that might be an issue? I would have thought that doing a "save as" would be pretty generic from WIN10 to WIN11...
VBA Code:
Dim sFileName As String
With Sheets("WORK ITEM TEMPLATE")
.Visible = True
.Calculate
sFileName = Range("B17").Value & " " & Range("B7").Value
sFileName = Application.GetSaveAsFilename(InitialFileName:=sFileName, Filefilter:="PDF (*.pdf), *.pdf", Title:="Save Print Output As")
If sFileName <> "False" Then
.PrintOut Copies:=1, Collate:=True, PrToFileName:=sFileName
End If
Thanks for any help as always,
-=ZM=-