vba code not printing my excel pages correctly

khalid7977

New Member
Joined
May 17, 2024
Messages
3
Office Version
  1. 2003 or older
Platform
  1. Windows
Hello,
I have this vba code, its printing my excel data pages each 5 hours, it was working good, but i formatted my pc then got this problem,
the problem is some pdf pages not showing the data completely, its showing data partly.
here is my simple code:
For i = 1 To 57
sheetxx(i).Select
Application.Wait (Now + TimeValue("0:00:05"))
pdffilename = fname2 & "\" & sheetxx(i).Name & ".pdf"
jpegfilename = fname2 & "\" & sheetxx(i).Name & ".jpg"
Shell ("D:\khalid\nircmd.exe savescreenshot " & jpegfilename)
Shell ("D:\khalid\screentopdf.exe " & jpegfilename & " " & pdffilename)
sheetxx(i).Select
sheetxx(i).ChartObjects(1).Activate
For Each objCht In ActiveSheet.ChartObjects
objCht.Chart.Export fname1 & i & ".gif", "GIF"
Next objCht
Next i

Please help me. Thank you.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
It looks like you are making screenshots rather than printing.
so this probably means that your data does not show on the screen completely. So maybe zooming the sheets may help?
Can you show an example of the output and what result you would expect ?
 
Upvote 0
It looks like you are making screenshots rather than printing.
so this probably means that your data does not show on the screen completely. So maybe zooming the sheets may help?
Can you show an example of the output and what result you would expect ?
Hi
Thank you for your time and help. Here see 2 files. Sometimes the data not shown and sometimes its shown completely. Thank you again for your time.
 
Upvote 0
Hi
Thank you for your time and help. Here see 2 files. Sometimes the data not shown and sometimes its shown completely. Thank you again for your time.
I see no files here.
 
Upvote 0

Attachments

  • Screenshot 2024-06-12 123322.jpg
    Screenshot 2024-06-12 123322.jpg
    197.5 KB · Views: 18
  • Screenshot 2024-06-12 123106.jpg
    Screenshot 2024-06-12 123106.jpg
    63.1 KB · Views: 9
Upvote 0
Sorry, i uploaded them already, i shall do it again.
If you look at your previous two posts in this thread, you can see that there is nothing attached. Actually, you cannot upload files to this site at all, only images.

There is a tool that will allow you to post images in a way that others can copy and download them, formulas included.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top